There are a couple of things you should do.

1. Since this is running as root, simply create a file in /etc/cron.d/ with the 
same line in the file. The files in
/etc/cron.d/ require a user and crontabs require that you NOT specify the user 
as the user is inherited from the owner
of the crontab.

2. Add a PATH and MAILTO statement at the beginning. The PATH will ensure that 
the environment is set up correctly to
run the command and the MAILTO will send STDOUT and STDERR to you in an email 
so you know what is going on.

Tony Heal
Pace Systems Group, Inc.
800-624-5999
[EMAIL PROTECTED]
 

> -----Original Message-----
> From: Magicloud Magiclouds [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 19, 2007 12:14 AM
> To: debian-user@lists.debian.org
> Subject: Why this crontab does not work?
> 
> Dear all,
>     I have a crontab like this:
> 
> [EMAIL PROTECTED] # crontab -l
> # m h  dom mon dow   command
> *       0,12    *       *       *       root    /root/update.sh
> [EMAIL PROTECTED] # more /root/update.sh
> #!/bin/bash
> apt-get update
> apt-get upgrade -d
> apt-get autoclean
> apt-get autoremove
> touch /root/update.sh
> [EMAIL PROTECTED] # ls -l /root/update.sh
> -rwxr-xr-x 1 root root 104 2007-07-19 09:01 /root/update.sh
> 
> 
>     But it seems that the script have never been called.
> 
> Thanks.
> 
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to