rsync --compare-dest creates all dirs and symlinks
Hi all,
Being a rsync newbie, I wanted to use rsync for frequent backups that
should only contain the changes.
First I made copy of the important partition of the remote PC ("gany")
using dd and mounted the resulting local file using a loop device under
/mnt/gany.
Then I tried:
rsync -Haziv --compare-dest=/mnt/gany/lib --compare-dest=/data/A/gany.1 \
root@gany:/lib/ /data/A/gany.1
I expected that rsync check everything and then finished without having
anything created, because there is no change between the loop-mounted
filesystem and the actual filesystem on "gany". Or at least create nothing
more than /data/A/gany.1/lib.
What happens is that rsync creates the whole tree of directories below
/data/A/gany.1/lib and also created all symlinks within that tree.
My Questions:
- Is there a way to avoid that?
(I also tried something similar with --link-dest but that produced
rather similar results.)
- If there is no way to avoid creating the directory tree and the
symbolic links:
-- is there any better way to find out what is REALLY different between
the loop-mounted filesystem and the newly created one, other than
fiddling with "diff -r" and some processing for the symbolic links?
(If there would a way to find out what's really new, I could just let
it make the dir tree, then do the find-really-new-processing and
delete everything that equally exists within the loop-mounted
filesystem.)
Sorry if this has been asked before. In that case, could someone give
me a pointer/link to the answer(s). Any help is very much appreciated!
Best regards
Dirk
--
To unsubscribe or change options: [url]https://lists.samba.org/mailman/listinfo/rsync[/url]
Before posting, read: [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url]
Re: rsync --compare-dest creates all dirs and symlinks
Note further also that using the option --prune-empty-dirs does not prevent all the empty dirs from getting created at the destination.
However, one could do a post-processing step such as
find /path/to/destination-dir/ -depth -type d -print | xargs rmdir
This gets rid of all the bogus empty directories, so tha one can see better what is really going on.
To get rid of unwanted symlinks, I'm not sure what to do. Could be tricky.
[QUOTE=unix;513392]Hi all,
Being a rsync newbie, I wanted to use rsync for frequent backups that
should only contain the changes.
First I made copy of the important partition of the remote PC ("gany")
using dd and mounted the resulting local file using a loop device under
/mnt/gany.
Then I tried:
rsync -Haziv --compare-dest=/mnt/gany/lib --compare-dest=/data/A/gany.1 \
root@gany:/lib/ /data/A/gany.1
I expected that rsync check everything and then finished without having
anything created, because there is no change between the loop-mounted
filesystem and the actual filesystem on "gany". Or at least create nothing
more than /data/A/gany.1/lib.
What happens is that rsync creates the whole tree of directories below
/data/A/gany.1/lib and also created all symlinks within that tree.
My Questions:
- Is there a way to avoid that?
(I also tried something similar with --link-dest but that produced
rather similar results.)
- If there is no way to avoid creating the directory tree and the
symbolic links:
-- is there any better way to find out what is REALLY different between
the loop-mounted filesystem and the newly created one, other than
fiddling with "diff -r" and some processing for the symbolic links?
(If there would a way to find out what's really new, I could just let
it make the dir tree, then do the find-really-new-processing and
delete everything that equally exists within the loop-mounted
filesystem.)
Sorry if this has been asked before. In that case, could someone give
me a pointer/link to the answer(s). Any help is very much appreciated!
Best regards
Dirk
--