Steve Holdoway wrote:
> Cron has no environment set. Specifically, your $PATH is non-existant so it 
> can't find shutdown. If you use 'which shutdown' to find the actual command, 
> then add the path to it in your crontab entry, then all should work.
>
> HOWEVER, you should never, ever use vi directly to create crontab entries: 
> use crontab -e, which invokes vi, but then informs cron that it's got a new 
> setup.
>
> hth,
>
> Steve
>
> On Thu, 04 Jan 2007 09:33:24 +1300
> Roger Searle <[EMAIL PROTECTED]> wrote:
>
>   
>> Having created a cron job (with vi, no less!) to shut down this machine
>> at 8pm each night I am not sure why it will not run.  I have in root's
>> crontab:
>>
>> nine:/home/roger # crontab -l
>> # DO NOT EDIT THIS FILE - edit the master and reinstall.
>> # (/tmp/crontab.XXXXkg1smT installed on Wed Jan  3 11:50:29 2007)
>> # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie
>> Exp $)
>> 0 20 * * * shutdown -h -t secs 1
>>
>> In webmin I see that the job is active and can successfully run it
>> manually from there, and can run shutdown from a command line.  I am
>> missing something - why will it not run via cron?
>>
>> Cheers,
>> Roger
>>     
Thanks for both the replies.  I am using crontab -e to edit.  I have
looked at /etc/cron.deny which is empty, and have created cron.allow
with my user as the only entry.  The command is /sbin/shutdown.  It
seems to be working correctly now.

Reply via email to