(SOLVED) Clean rsync deleted copies, best solution?


je82

Recommended Posts

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 by je82
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.