[ale] cron question
Geoffrey
esoteric at 3times25.net
Sat Jun 10 09:34:22 EDT 2006
Marvin, International Martian of Mystery wrote:
> I have a cron job set to run thusly in my root crontab:
>
>
> [root at zminder root]# crontab -l
> # DO NOT EDIT THIS FILE - edit the master and reinstall.
> # (/tmp/crontab.12165 installed on Mon Apr 24 22:56:36 2006)
> # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
> 0 1 * * * /var/www/html/zm/events/cleanup.sh
>
>
>
> As you can see it's supposed to run every morning at 1 AM. This is the
> script it's supposed to run:
I suspect that it's because you're using relative paths. If this is the
root crontab, it's going to cd in reference to $HOME for root which is
/root on most boxes. You should also fully qualify your calls to
binaries (/binrm). Firstly, it could be that it's not in root's path.
Secondly, it could be aliased, which rm often is, and therefore is
expecting a confirmation of the removal, which it will never get via
cron. Have you checked the local root email to see if you're getting
any complaints from cron?
>
>
>
> #! /bin/sh
>
> cd ./9
>
> rm -Rf *
>
> cd ../12
>
> rm -Rf *
>
> ...etc.
>
> As you can see, all it does is delete any and all files and
> sub-directories under the various directories it's changing into. The
> script works fine run from the command-line.
>
> The cron-job never happens, though. I can't figure what's wrong.
> Anybody able to clue me in as to what needs to be done? This is root's
> crontab, btw...
>
>
> Thanx.
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
--
Until later, Geoffrey
Any society that would give up a little liberty to gain a little
security will deserve neither and lose both. - Benjamin Franklin
More information about the Ale
mailing list