1

I can successfully run this command in the terminal:

find /home/www/files/1 -type f -name '*' -mtime +180 -exec rm {} \

However when I add it as a cron job like so:

*/5 * * * * find /home/www/files/1 -type f -name '*' -mtime +180 -exec rm {} \

It doesn't work and the system sends a mail saying find: missing argument to '-exec'

What can I do to make it work as a cron task?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Dan P.
  • 209

1 Answers1

2

You are missing the semi colon at the end of the -exec argument.

jmw
  • 21