If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Easy-to use cron-system.

ASUS WL-Series XXXXXX Tutorial

The guide is made using a ASUS WL-500G Deluxe (or WL-500GX as it is sometimes called).
It should however apply to all the ASUS wireless line of products that are Linux based. Theese products are to my knowledge :

ASUS WL-500b
ASUS WL-500bv2
ASUS WL-500g
ASUS WL-500g Deluxe (WL-500gx)
ASUS WL-HDD
If you are the lucky owner of any of the above devices, you have come to the right place.
If you still dont have one of the above devices - dont hesitate, go buy one :-)

After following the steps in this tutorial, your ASUS WL device will have all its normal functionality, and also enable you to run sheduled tasks at specified intervals.

When running a server it is often nice to be able to run specific tasks at pre-defined intervals. Sometimes it is nice to be able to strip logs every day, check for internet connection every 5 minutes or do something else every XX minutes/hours/days/weeks/months.

After following this tutorial you will be left with an easy-to-use crontab based system, that enables you to run tasks at specified intervals, with no knowledge about cron.
The system is somewhat simular to the crontab implementation of RedHat

Tutorial Index
1. Prerequisites - What is needed to get started.
2. Installing and Configuring cron

Notice: In the above I have used "root". This should be changed to the login name that you use on the web interface of yor router. Default name for the ASUS devices is "admin".

As also noted in the file, the syntax for each line is : minute hour day month dayofweek command
To take an example, the command: run-parts /opt/etc/cron.weekly is executed at time :

Code:

minute : 22
hour : 4
day : *
month : *
dayofweek : *

Where "*" is a wild-card meaning "ALL".
Thus the command is running : Every day of week, Every Month, Every Day at 4:22
Note that cron uses a 24h clock.

This means that 4:22 is 4:22 AM, 4:22 PM would be indicated as :

Code:

22 16 * * 0 root run-parts /opt/etc/cron.weekly

The special */5 in the first line, means that this job is executed every 5 mins. At the minutes 5, 10, 15.....55.

Having created this config-file, all that is needed is the command "run-parts" which is not a part of the firmware.
For this purpos I created a small script which I named run-parts and placed in /opt/bin
A script like this will do the job: