I'd enclose your file list in quotes:
find /backup -name 'data*' -atime +1 -exec rm -f "{}" ';'
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.
--
Until later: Geoffrey                ">esoteric@denali.atlnet.com
I'm afraid there will be more problems with W2K than there were with
Y2K...
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.