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.
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.
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:
find /path/to/files -name "*" -mtime +30 -print0 | xargs -0 rm
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.