Looks like that worked, must say I don't understand the quoting, but it
seems to work, will find out at 0200 when the next backup runs. Thank
you.
Sue Bauer-Lee wrote:
>
> First, I would try to escaping and quoting those that require it.
> I'm assuming of course that you're running bash when you test it
> independantly of cron.
>
> you can set debug mode from the script itself by:
> #!/bin/sh -x
>
> find /backup -name 'data*' -atime +1 -exec rm -f {} \;
>
> On Fri, Mar 24, 2000 at 08:26:55PM -0500, jonathan wrote:
> > I have a script that I would like to use to clean out a backup directory
> > of files that are older than 2 days. I can run the script manually, but
> > when I put it in as a cron job, it doesn't run. Here is the script and
> > crontab if anyone can see a problem I would appeciate it. The error
> > message in roots mail when it runs with cron is "find: paths must
> > precede expression". TIA
> >
> > /usr/local/scripts/remove_backups:
> > #!/bin/sh
> > find /backup -name data* -atime +1 -exec rm -f "{}" ';'
> >
> >
> > crontab:
> > SHELL=/bin/sh
> > PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
> > MAILTO=root
> >
> > #-* * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun
> > 0 2 * * * root /usr/local/scripts/remove_backups
> > 0 3 * * * root /usr/local/scripts/backup
> >
> > #
> > # check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
> > #
> > -*/15 * * * * root test -x /usr/lib/cron/run-crons &&
> > /usr/lib/cron/run-crons
> > 0 0 * * * root rm -f /var/cron/lastrun/cron.daily
> > 0 0 * * 6 root rm -f /var/cron/lastrun/cron.weekly
> > 0 0 1 * * root rm -f /var/cron/lastrun/cron.monthly
> > --
> > To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.
>
> -----------------------------------------------------
> Sue Bauer-Lee | KE4HNN
> PO Box 2900 |
> Lilburn, GA 30048 | Email: ">sblee@tazmania.org
> -----------------------------------------------------
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.