

Vivek Gite is the founder of nixCraft, the oldest running blog about Linux and open source. See official project help page for more info here and here. You can then put your “cru” commands inside a user script to re-generate your cron jobs at boot time. However, a simple way to manage your cron jobs is through the included “cru” command as described here.

A boot time copy it to /var/spool/cron/crontabs/ using an init-start user script. Note that this location resides in RAM, so you would have to put your cron script somewhere such as in the jffs partition such as /jffs/scripts. The file must be named “admin” as this is the name of the system user. You can put your cron tasks in /var/spool/cron/crontabs/. You can create scheduled tasks using the standard crond service that runs on the router. Support for these scripts stored under /jffs/scripts/ must be enabled, under Administration -> System on the webui:Īnd there you have it, I just add cron job on Asuswrt Merlin Wifi Router. Make sure you set executable permission using the chmod command:Ĭhmod a+rx /jffs/scripts/usb-backup-script.sh Enable boot time support for /jffs/scripts/ The syntax is pretty simple: Add a new cron jobĬru a cru command syntax to add, list, and delete cron jobs It also checks the /var/spool/cron/ directory.

The cron service (daemon) runs in the background and constantly checks the /etc/crontab file, and /etc/cron.*/ directories. Cron is one of the most useful tools in a Linux or UNIX like operating systems. You can schedule scripts to be executed periodically. What is a cron on Linux?Ĭron allows Linux and Unix users to run commands or scripts at a given date and time. You need to use the cru command to list, delete, or add new cron jobs. The echoed value is the randomly generated MAC address (it always starts with 00, I know it's bad.).How to add cron job on Asuswrt Merlin Wifi Router Here is what I have to set the MAC to a random value: MAC=`(date cat /proc/interrupts) | md5sum | sed -r 's/^(.)/\1:/g s/:$// '` Unfortunately, I can't exactly cron the GUI, nor can I have it select the MAC randomly from the GUI.

After giving up on scripts, I decided to try using the built in "MAC clone" function in the GUI It worked like a charm. I've tried many different scripts, but none seem to work with my router model (Buffalo WZR-HP-G300NH). Perhaps it would be best if I explained my plight? What I want to create is a script that I can run that will randomly set the MAC address of the router to get a new IP address. I can do it in the GUI (of course), but I want to place it in a script so that I can cron and randomize it. I'm trying to figure out a way to invoke the "mac clone" command found under the "setup" menu in DD-WRT v24SP2.
