RE: Why this crontab does not work?
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
theal@pace2020.com
> -----Original Message-----
> From: Magicloud Magiclouds [mailto:magicloud.magiclouds@gmail.com]
> 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:
>
> root@localhost # crontab -l
> # m h dom mon dow command
> * 0,12 * * * root /root/update.sh
> root@localhost # more /root/update.sh
> #!/bin/bash
> apt-get update
> apt-get upgrade -d
> apt-get autoclean
> apt-get autoremove
> touch /root/update.sh
> root@localhost # 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 debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: