• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

deleting files older then a certain date

Red Squirrel

No Lifer
I have a backup server which has about 20 or so jobs that run at different times and use rsync to pull all the data and put it in the right folders on the right drives. I am not using the option to delete files that were deleted from the source, as this backup is also to be able to get to stuff that I deleted by accident, or realized that I actually want back.

But leaving it like this will eventually fill the drives and it is curently setup so that I can do full disk backups and have enough room as the capacity of the server's Disks corresponding to a job are bigger then the disks being backed up. However leaving old files will eventually call for failure, and this backup server is out of sight out of mind, well besides the cron log which ends up in my inbox.

So what I'd like to do is make it so that files older then 30 days get deleted. But if this file gets updated, then it will reset the time. Without some crazy ubb3r 1337 H4X0R bash script, is there a way to do this? I was even thinking of going by file size. Ex: files smaller then 5MB stay for 3 months, files smaller then 2GB but bigger then 5MB stay for 1 month and anything bigger for 15 days.

Oh and if some crazy bash code is required it's fine but you'll have to explain it line by line since I only know very basic bash.

Thanks in advance!
 
Back
Top