Carlos E. R. said the following on 05/06/2013 10:38 PM:
On Monday, 2013-05-06 at 21:36 -0400, Anton Aylward wrote:
Carl Hartung said the following on 05/06/2013 07:27 PM:
piping example:
rsync -rvn --delete /source/ /target | less
Does that tell you what its going to delete?
Yes, but mixed with the thousands of other things it does. And as there is no "--dry-run" above, by the time you notice it may be too late.
Ouch! As in *O*U*C*H*!*!*!
redirection example:
rsync -rvn --delete /source/ /target >somefilename.txt
--delete delete extraneous files from destination
Not the source? So what does that mean?
Not the source :-)
So this isn't doing a "mv" type of operation where the source is deleted after copy. I use rsync as a form of "mv" where "mv" isn't up to it.
Ok, I don't know the differences between the different variations of "delete" (after, during, etc). The important thing is that it deletes things in the target directory. What? An example is easier.
Suppose you do a backup of a directory.
Then you delete some files in the source directory, create new files, change other files - the typical use of a computer.
A week later you do another backup of the same source and same target. Changed and new files will be copied to the destination, but the deleted files... what? They will simply remain in the backup copy.
Oh YES! Isn't that what a 'backup' means? How else might I be able to recover deleted files?
If you have to do a restore, it will be incorrect, because those files you deleted intentionally will be recovered.
Well, that's one view. Still have a copy of something that was deleted and getting it back is another.
Yes, but there is a better way - for backups.
Right. Install a carousel with tape changer and handler and ...
You can have a backup directory for week 1, another for week 2, etc. All of them contain only what was present at the time they were made, no more, no less. Deleted files during the week are in week_1 directory but not in week_2.
Or RCS or Subversion or Git. Or many more variations.
There are scripts that handle this type of backups automatically, like "rsnapshot". But the functionality is that of "--link-dest" in rsync.
Basically:
rsync $OPTIONS --link-dest=$PREVIOUS $SOURCE/ $DESTINATION
Well that isn't a lot of use for the use-cases I have. My use of rsync is across machines or moving a tree to a new partition to free up space. -- Associate yourself with men of good quality if you esteem your own reputation; for 'tis better to be alone than in bad company. --George Washington -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org