crontab and reboot

Rashkae ubuntu at tigershaunt.com
Thu Nov 25 13:23:54 UTC 2010


On 10-11-25 06:35 AM, Oliver Marshall wrote:
>
> Hi chaps
>
> If I want to schedule a reboot every four hours, do i need to enter 
> the command as;
>
> 01 /4 * * * root shutdown now -r
>
> or
>
> 01 /4 * * * shutdown now -r
>
> (note the lack of root).
>
> I'm using the latter but it's not working.
>
> Olly
>

Depends on which crontab you are using.

There is a system wide crontab in /etc/crontab (as well as files in the 
/etc/cron.d directory).  They require you to specify the user to run as 
(ie,, with the root.)

However, each user is also allowed to have his/her own crontab file 
(kept in the /var/spool/cron/crontabs directory).  These are the cron 
files that get intalled with the crontab command, and you do not specify 
a username in the file for them)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20101125/837fe851/attachment.html>


More information about the ubuntu-users mailing list