Have rsync Replace Files With More Recent Version


asopala
Go to solution Solved by strike,

Recommended Posts

Hey all,

 

I'm in a weird situation with rsync where I can't seem to be able to have it copy over the most recent version and replace deprecated versions of a file.  I use an audio program called Pro Tools, and changes are done in the .ptx file itself, with incremental changes saved to the file itself.  The issue is that rsync just sees test.ptx is both in the synced folder and the original, ignoring the fact that the synced file is an old version, the one that was copied over the first time.  So the question is if it's possible to have rsync copy over the most recent versions of files, removing the old versions and replacing them with the new version of the file with the same name.

 

As an example, here's a script that transfers from a local backup I have of my server to an offsite server (cause I haven't figured out how to get the two computers to communicate, hence I've had to shlep a hard drive over every time I visit to sync the two).

 

rsync -ah "/mnt/disks/WD_easystore_264D/AlexNAS_Backup/test/" "/mnt/user/test"

 

Link to comment
53 minutes ago, strike said:

Try 

rsync -auv "/mnt/disks/WD_easystore_264D/AlexNAS_Backup/test/" "/mnt/user/test"

 

Test it with a dry run first to see what it does without actually changing anything:

rsync -auvn "/mnt/disks/WD_easystore_264D/AlexNAS_Backup/test/" "/mnt/user/test"

 

 

That did it.  Thanks!

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.