Random Google searches can be hazardous to your crontabs

I have been using Openwrt for the last three months and it is a vast improvement over the limited options of the DD-WRT system that was very useful and servicable but was not as flexible and well ..fun.. to use as OpenWRT.

I ran into a snag with crontab the other day when noticing that none of my scripts were running at all. After trying everthing possible I ran into something that new OpenWRT users need to heed.

For instance have you noticed that many places on the internet will give crontab examples thusly:

30 2 * * * root /root/my_favorite_script
40 4 * * * root /root/my_second_favorite_script

This will NOT WORK on OpenWRT systems.
You need to remove the user column because each crontab file is given the user name.

Thus in OpenWRT the innards of /etc/crontabs/root file would be thus

30 2 * * * /root/my_favorite_script
40 4 * * * /root/my_second_favorite_script

Note there is no user column as above.
That's what sometimes happens when you use random Google searches for solutions to problems.

After that all my scripts are working. Even still the minor differences are not that great. It is still crontab.

1 Like

the former is the format for system-wide files in /etc/cron.* (cron.d, cron.daily ..)
while the latter (without the user column) is for user-specific crontabs.