So I have a cron setup to make backups of a folder into a tarball every hour. I would like to add into the shell script that I'm using the ability to have files deleted automagically after about three days, so that I don't have a crap ton of files.
How can I go about this? Thanks.
Best Answer
Add this line to the script (modify accordingly):
This assumes your backup tarballs and only your backup tarballs reside in that folder. You could also use the
tmpwatch
utility: