Is it possible to backup with rsync, follow root symlink, but preserve the rest of the symlinks? <p>I'm setting up a backup using rsync. I'd like to specify the root source directory using a symlink that points to it, but for the rest of the archived tree, I'd like to preserve the symlinks. </p> <p>Further, I'd like to preserve the symlink name as the root in the backup archive.</p> <p>The reason for this setup (which may, or may not, be very smart) is that the source is a versioned app, where the version numbers will increase over time. I only want to backup the latest version and I want rsync to remove older files from the backup archive.</p> <p>Example source: </p> <pre><code>source_symlink -&gt; source-1.2.3 source-1.2.3/ file1.txt dirA/ fileA.txt symlink_fileA -&gt; dirA/fileA.txt </code></pre> <p>If I attempt to backup this with</p> <pre><code>rsync -av --delete source_symlink destination_dir </code></pre> <p>I simply get a copy of the symlink inside my destination; like this:</p> <pre><code>destination_dir/ source_symlink -&gt; source-1.2.3 </code></pre> <p>I.e. a symlink pointing to a non-existing directory. </p> <p>If I resolve the symlink myself, e.g. like this:</p> <pre><code>rsync -av --delete $(readlink -f source_symlink) destination_dir </code></pre> <p>I get the following:</p> <pre><code>destination_dir/ source-1.2.3/ file1.txt dirA/ fileA.txt symlink_fileA -&gt; dirA/fileA.txt </code></pre> <p>This is ok until I change the symlink to, for example the next version; e.g. <code>source_symlink -&gt; source-2.0.0</code>. In that case, I end up with duplicates in the archive:</p> <pre><code>destination_dir/ source-1.2.3/ source-2.0.0/ </code></pre> <p>What I'd like is that the root symlink is followed, but the rest of the symlinks are preserved. Further, I'd like to have the symlink name in destination directory. Like this:</p> <pre><code>destination_dir/ source/ file1.txt dirA/ fileA.txt symlink_fileA -&gt; dirA/fileA.txt </code></pre> <p>Is this possible to achieve?</p>