rsync - clever suggestion needed
Hi,
Start off point: Server1 has file1 at /home/user1/ Server2 has file1 at /home/user2/ How do I use rsync to delete file1 at server2, on the basis that it exists on server1? I think I need the inverse of --delete, which deletes everything that isn't at server1, but is at server2. Does rsync have a function that will remove files from the destination that are already at the source? Cheers, Ape |
You could build a list of all files you have in the source, put that in an exclude file and call rsync with --delete-exclude.
But rsync seems not to be the correct tool as it focuses on syncing, and what you want is explicit non-syncing. It might be better to build a list of files you have in source, open a SSH to dest and delete files you have in dest. If the file doesn't exist, you won't delete it. jlinkels |
Non-rsync solution
Hi,
I've solved this by: Code:
LOCAL_DIR=/home/user2/ |
All times are GMT -5. The time now is 05:46 PM. |