Jump to content

Cron reboot command?


Recommended Posts

Hi all,

Just got a LT last week, and liking it so far. Though my plan for it requires it be placed in a remote location I can't get into without some effort.

That said I want to use cron to reboot the LT on a time schedule, either a specific time say 1AM EST, or after a certain amount of uptime.

I've had no luck with the entries I've made into cron so far.


0 1   *   *   *    root reboot > /dev/null 2>&1
0 1   *   *   *    /sbin/reboot


If anybody can help me find a working cron reboot setup I'd be so very grateful!





Link to comment
Share on other sites

well from what I can tell the turtle uses NTPD and gets a accurate time after booting up.

At this point I just want to know what correct command to input into cron to trigger a reboot? even if it happens at the wrong time, it'd be something.


Link to comment
Share on other sites

Alright I got it working.

NTP gets an accurate time.

Though I had to edit /etc/config/system

and change it to my time zone. As referenced at openwrt wiki


config system
       option timezone 'EST5EDT,M3.2.0,M11.1.0'
       option hostname 'turtle'

config timeserver 'ntp'
       list server '0.openwrt.pool.ntp.org'
       list server '1.openwrt.pool.ntp.org'
       list server '2.openwrt.pool.ntp.org'
       list server '3.openwrt.pool.ntp.org'
       option enabled '1'
       option enable_server '0'

config led 'led_wan'
       option name 'WAN'
       option sysfs 'turtle:yellow:system'
       option trigger 'netdev'
       option dev 'eth1'
       option mode 'link tx rx'


Then I also took a page from their wiki noting how to perform automatic reboots.

So I edited my crontab to this: (will reboot automatically at 4:30AM)


30 4 * * * sleep 70 && touch /etc/banner && reboot


And this worked perfectly!

Hope this helps someone else too. I just can't be totally trusting of the turtle's reliability in the case of some lock up, or what not. So this will give me a chance to have it reboot nightly and re-connect if possible.


Thanks all.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...