I use rsync in a cron script to maintain a remote copy of some things. When I first set this up I did not have things deleted on the remote copy. Being an archive, I felt a few extra files are better than missing ones. I would now like to delete the remote-only files in a controlled fashion. So I have run this command to see what would be deleted: rsync -nazv --delete --delete-after --rsh=ssh theDir backup:/vol1/theDir My question is, would this rsync command only delete files on the destination system? In my case, in backup:/vol1/theDir? I do not want anything deleted in 'theDir'. I do not expect that there are any local files that are not in the remote. But just in case. In my dry run, I saw that there were many hundreds of files that could be deleted. Perhaps I should just collect the names and see if they exist locally. Which they should not... But would rsync ever delete files in 'theDir'? Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Roger Oberholtzer wrote:
I use rsync in a cron script to maintain a remote copy of some things. When I first set this up I did not have things deleted on the remote copy. Being an archive, I felt a few extra files are better than missing ones.
I would now like to delete the remote-only files in a controlled fashion. So I have run this command to see what would be deleted:
rsync -nazv --delete --delete-after --rsh=ssh theDir backup:/vol1/theDir
My question is, would this rsync command only delete files on the destination system? In my case, in backup:/vol1/theDir? I do not want anything deleted in 'theDir'. I do not expect that there are any local files that are not in the remote. But just in case.
In my dry run, I saw that there were many hundreds of files that could be deleted. Perhaps I should just collect the names and see if they exist locally. Which they should not... But would rsync ever delete files in 'theDir'?
No, rsync does not do anything to the source files or directories. -- Per Jessen, Zürich (17.6°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 6/8/2012 3:56 AM, Roger Oberholtzer wrote:
I use rsync in a cron script to maintain a remote copy of some things. When I first set this up I did not have things deleted on the remote copy. Being an archive, I felt a few extra files are better than missing ones.
I would now like to delete the remote-only files in a controlled fashion. So I have run this command to see what would be deleted:
rsync -nazv --delete --delete-after --rsh=ssh theDir backup:/vol1/theDir
My question is, would this rsync command only delete files on the destination system? In my case, in backup:/vol1/theDir? I do not want anything deleted in 'theDir'. I do not expect that there are any local files that are not in the remote. But just in case.
In my dry run, I saw that there were many hundreds of files that could be deleted. Perhaps I should just collect the names and see if they exist locally. Which they should not... But would rsync ever delete files in 'theDir'?
With one exception rsync only operates in one direction, source to dest. Dest may be local or remote, but the last path/file on the command line is the dest and all else are source(s). Files will only be created, modified, or deleted or touched in any way than reading, on the destination. The only option I know of that even touches the source files is --remove-source-files, so just "don't do that". None of the --del* options or any other option ever touches the source files. You only need --del not "--delete --delete-after" Or did you just do that to make the -n output easier to read? -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Brian K. White
-
Per Jessen
-
Roger Oberholtzer