Results 1 to 13 of 13

Thread: Howto use cron for scheduling tasks

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308

    Howto use cron for scheduling tasks

    Everyone using this router for more than the usual stuff will get to a point where one or more tasks need to be scheduled to run once in a while. Unix/Linux provides the cron daemon to do this job and you can use it on the WL-500g as well.

    What you need:
    -The full busybox (from the downloads section of this forum)
    -An USB mass storage device like an USB pen or USB HDD

    Preparing the cron daemon:
    - The cron daemon needs a configuration file located in '/var/spool/cron/crontabs'. Create these directorys with 'mkdir'
    - Run the cron daemon with the following command (I assume the full busybox is in the root of your USB device): '/tmp/harddisk/busybox crondtab -e'. This will start the cron daemon in the configuration mode.
    - Add your daily tasks to the configuration file. Additional info can be found here: http://www.techtutorials.net/tutorials/unix/cron.shtml
    - Now the file created by crontabs holds the configuration. The filename is the username who started crontabs (e.g. 'admin'). This file needs to be restored between reboots using the flashfs system. Add the configuration file to /usr/local/.files (e.g. 'echo /var/spooler/cron/crontabs/admin >> /usr/local.files').

    Last step, running the daemon at each boot:
    To make sure the cron daemon is running after each reboot we need to put it into the /usr/local/sbin/post-boot script. Add the following line: '/tmp/harddisk/busybox crond'.

    Save the changes with the following commands: 'flashfs save' and 'flashfs commit' and reboot the router.
    Last edited by Styno; 23-01-2007 at 12:43. Reason: fixes, broken link reported by 'jam' (thanks!)

Similar Threads

  1. Easy-to use cron-system.
    By macsat in forum WL-500g/WL-500gx Tutorials
    Replies: 3
    Last Post: 29-05-2007, 21:18
  2. Script for scheduling pppoe connections?
    By Spot in forum WL-500g Q&A
    Replies: 4
    Last Post: 14-03-2005, 07:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •