cron job for deleting files older than 1 week

Jon Gale donjuanica at gmail.com
Fri Mar 9 16:56:37 UTC 2007


> I have strearipper recording my fave radio stations in to a folder for
> me to listen to later. Of course the folder fills until there is no
> space left on the disc.
> Could some one provide me with a sample script that I could run as a
> cron job and it would go through the streamripper folder deleting files
> older than 1 week (for example). Many thanks



If your files have spaces in the name you'll need to do something like this:

find /path -name 'stream*.mp3' -mtime +6 -print0 | xargs -0 rm -f

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070309/7aa41c17/attachment.html>


More information about the ubuntu-users mailing list