crontab and reboot
Karl Auer
kauer at biplane.com.au
Thu Nov 25 15:05:45 UTC 2010
On Thu, 2010-11-25 at 14:36 +0000, Oliver Marshall wrote:
> Is there another way to schedule commands? This NAS box overwrites the
> crontab entries on each reboot, so scheduling a reboot works only
> once, then the new crontab entries get removed.
>
Run startup script that uses at to schedule a reboot. Call this script
reboot_later and put it in your startup sequence:
#!/bin/sh
/root/reboot_in_four_hours &
Call this script reboot_in_four_hours and put it in /root
#!/bin/sh
sleep 14400
reboot
Alternatively, call this script reboot_later and put it in your startup
sequence:
#!/bin/sh
echo reboot | at now + 4 hours
Note: All the above is totally untested!
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au) +61-2-64957160 (h)
http://www.biplane.com.au/kauer/ +61-428-957160 (mob)
GPG fingerprint: B386 7819 B227 2961 8301 C5A9 2EBC 754B CD97 0156
Old fingerprint: 07F3 1DF9 9D45 8BCD 7DD5 00CE 4A44 6A03 F43A 7DEF
More information about the ubuntu-users
mailing list