Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My OpenWRT 10.03.1 Router (Linksys WRT160NL) is ignoring my crontab (set via System->Scheduled tasks). I want to reboot the router every night, since it tends to get flaky after some days. So I entered this in my tasks:

0 5 * * * reboot

I also tried

0 5 * * * root /sbin/reboot

but this was also ignored. Is there some kind of setting that I have to do, so that cron will be actually run? When I log into the router via ssh, and run ps, I don't see any cron process.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

By default OpenWrt does not enable the cron service. To start it and enable automatic startup during subsequent reboots, you need to execute the following commands:

/etc/init.d/cron start
/etc/init.d/cron enable

The first command starts the cron service once, but does not change the startup configuration, so it will not be started automatically after a reboot. The second command changes the startup configuration (creates a symlink in /etc/rc.d) so that the cron service will be started during boot, but does not start it immediately.

share|improve this answer
    
This worked perfectly! –  Arne May 27 '13 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.