cru enables you to check/add/delete cron job on your Asuswrt Merline Wifi Router. Because Asuswrt does not save all the cron job by the limited storage, you should add cron job at /jfss/scripts/init-start, so the cronjob will be done as designed. |
cru a {id} min hour day moth week command |
Where:
cru l |
cru d {id} |
Let us add cron job on Asuswrt Merlin Wifi router to ping gateway every 1 hour, run:
cru a pinggw "0 * * * * /bin/ping -c 10 -q 192.168.2.254" |
Above cron job will run /bin/ping command that sends only 10 pings and only display output at start.
To list current jobs run:
cru l |
To delete current jobs run:
cru d pinggw |
Verify it:
cru l |
Type the following command
vi /jffs/scripts/init-start |
And add your command like below. Below is the case to update DNS every 10mins
cru a ddns "*/10 * * * * /usr/sbin/wget -O /dev/null 'http://ddns.dnszi.com/set.html?user=<your_id>&auth=<your_auth>&domain=<your_domain>&record=<your_record>'" |
Reboot Asuswrt every 12 hours
cru a reboot12 "0 */12 * * * /sbin/reboot" |
Reboot Asuswrt at 5:30 AM
cru a reboot0530 "30 5 * * * /sbin/reboot" |
To enable boot time support for /jffs/scripts/, you should check following options: