Thanks to everyone who responded. It was interesting to read all off the
variations of the syntax that was suggested. The more common suggestions
were as follows.
1. Use single quotes in stead of double quotes ('xferlog.*')
2. Use double quotes ("xferlog.*")
3. Use double quotes around the * (xferlog."*")
4. Escape the * (xferlog.\*)
5. Double quote and escape the * ("xferlog.\*")
The list goes on and surprisingly, they will all work. However, Dennis
Martens pointed out that cron is brain dead and that fully qualifying
ALL of the commands within the construct should fix it and it did. The
following construct finds all of the "xferlog.*" files and deletes them
every time.
0 12 * * * /bin/find /var/adm -name xferlog."*" -exec /bin/rm {} \;
This was a nice way to start a Monday....
Frank Everitt
> All,
> What am I doing wrong? I'm trying to do what would seem a
simple task
> of periodically looking for some files and if found, deleting. My
> obvious choice was to use the combination of cron and find. I
developed
> the following structure that worked at the command line, but fails
when
> run by cron.
> find /var/adm -name xferlog."*" -exec rm {} \;
>
> When inserted in the root's crontab, the command looks like the
> following.
>
> 0 12 * * * find /var/adm -name
xferlog."*" -exec rm {} \;
>
> The OS is 2.5.1, the user is "root", the shell is "sh" and I'm
> baffled.... I believe it's a shell/escape issue, but I can't find it.
>
> Will summarize. Please respond to frank.everitt@mci.com
>
> Thanks in advance.....
>
> Frank Everitt
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:49 CDT