je82 Posted February 2, 2020 Share Posted February 2, 2020 (edited) Hi, I've setup rsync to run every 3 days and copy files that are important, files that have been removed or changed are automatically moved on the backup server to /mnt/disk5/Deleted by using the "-backup-dir" switch in the rsync command. Now my /mnt/disk5/Deleted on the backup server is filling up and i need to make another script to clean this up. I was thinking of simply going by a simple "older than x days script" but i realize now that it may not work as i want it to because file creation time is not when they are copied to the deleted folder, it is rather when they are created on the backup server the first time. Running a script like: Quote find /mnt/disk5/Deleted/ -mindepth 1 -mtime +60 -delete Should delete all files older than 60 days but like i said many files may be older than 60 days when they first appear in the /mnt/disk5/Deleted/ so the effects may be grim wiping the entire /mnt/disk5/Deleted/ folder entirely. How would you best go about cleaning up this folder? The reason i ask is because i ran some trials in the folder before actually running it as this: Quote find /mnt/disk5/Deleted/ -mindepth 1 -mtime +1000 -depth -print and even running the command at 1000 days it still finds files in the path it wants to delete, i started using unraid backup server 2 months ago so there should be no files found running it at 1000 days. Any ideas? Edited February 2, 2020 by je82 Quote Link to comment
je82 Posted February 2, 2020 Author Share Posted February 2, 2020 well that was easy, i realize there are ctime and atime as well in unix, never mind Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.