<div dir="ltr">Hi folks,<div><br></div><div>I have a bunch of directories to mirror via rsync. I have lots of hardlinked files spread about these directories. Therfore I use <span style="color:rgb(0,0,0);font-size:12px">-R (--relative) and -H.</span></div>
<div><span style="color:rgb(0,0,0);font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12px">so far ok but:</span></div><div><span style="color:rgb(0,0,0);font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12px">I create symlinks to the source-directories via script because src-dirs have changing names (date and time of backup) and I want to have constant directory names on target. How can I achieve that? </span></div>
<div><span style="color:rgb(0,0,0);font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12px">I thought -k (</span><span style="color:rgb(0,0,0);font-size:12px">--copy-dirlinks) would work but this replaces ALL symlinks to dirs which exist in the copied tree to real directories. I just want to have the "symlink dir conversion" done on the starting directories dir1 and dir2</span></div>
<div><br></div><div>cd /tmp/backup</div><div><font color="#000000"><span style="font-size:12px">rsync -RaH --copy-dirlinks --stats --delete </span></font><span style="color:rgb(0,0,0);font-size:12px">--progress</span><span style="color:rgb(0,0,0);font-size:12px">  </span><span style="font-size:12px;color:rgb(0,0,0)">dir1   dir2   dest/</span></div>
<div><font color="#000000"><span style="font-size:12px"><br></span></font></div><div><font color="#000000"><span style="font-size:12px">dir1 and dir2 are symlinks to directories which contents have to be mirrored</span></font></div>
<div><font color="#000000"><span style="font-size:12px">I want to have real directories dest/dir1 and dest/dir2 after rsyncing and not only the symlink copied. Using </span></font><span style="color:rgb(0,0,0);font-size:12px"> -k (</span><span style="color:rgb(0,0,0);font-size:12px">--copy-dirlinks) the following hapens:</span></div>
<div><span style="color:rgb(0,0,0);font-size:12px"><br></span></div><div><font color="#000000"><span style="font-size:12px">src1/usr/bin/X11 -> .</span></font></div><div><font color="#000000"><span style="font-size:12px">becomes</span></font></div>
<div><font color="#000000"><span style="font-size:12px">dest/src1/X11/X11/X11 (and so on) because the symlink to "." gets a copy of the contents of the directory </span></font><span style="color:rgb(0,0,0);font-size:12px">src1/usr/bin/</span></div>
<div><font color="#000000"><span style="font-size:12px"><br></span></font></div><div><span style="font-size:12px;color:rgb(0,0,0)">I could do bind mounts for src1 and src2 but normaly I try to avoid bind mounts</span><br>
</div><div><font color="#000000"><span style="font-size:12px"><br></span></font></div><div><font color="#000000"><span style="font-size:12px">How do I mirror the contents of name name changing directories when I want to use fixed directorynames at destination. My symlink to dir approach was not successfull.</span></font></div>
<div><font color="#000000"><span style="font-size:12px"><br></span></font></div><div><font color="#000000"><span style="font-size:12px">Thanks</span></font></div><div><font color="#000000"><span style="font-size:12px"><br>
</span></font></div><div><font color="#000000"><span style="font-size:12px">lopiuh</span></font></div></div>