Some commands I use (i.e rsync) work fine in cron jobs; Will this:
find /path/to/files* -mtime +30 -exec rm {} \;
...or do I need to put it into a file? I can test it myself soon, however asking may save precious time.
|
feedback
|
|
No, this will not work. You can't give a wildcard to specify the place where to search. Use the -name parameter instead, like this:
I also made sure this command can handle lot's of files and files with spaces in it's name via the use of xargs instead of -exec. | |||||||||||
feedback
|
cronusessystem()to execute cronjobs, which gives the entire line to theshshell (for example,/bin/sh -c 'find ....'). In other words, if a command can be used insidesh, it can be used in a cronjob. – grawity Feb 1 '11 at 12:44