Sunday, 2 June 2013

find -time +7 fails with cron

find -time +7 fails with cron

Running this in a normal bash shell on Ubuntu works just fine:
/usr/bin/find somepath -mtime +7 -delete
Running the same thing in cron gives an error:
0 0 * * * /usr/bin/find somepath -mtime +7 -delete
/usr/bin/find: invalid argument `-delete' to `-mtime'
Should the "+" be escaped, or what is wrong? No documentation indicates this.

No comments:

Post a Comment