Chris's Wiki :: blog/sysadmin/RsyncAndHardlinks Commentshttps://utcc.utoronto.ca/~cks/space/blog/sysadmin/RsyncAndHardlinks?atomcommentsDWiki2022-02-16T20:56:44ZRecent comments in Chris's Wiki :: blog/sysadmin/RsyncAndHardlinks.By Walex on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:9caf824026ab9c7310db33152f3139107b25b51cWalexhttp://ww.sabi.co.uk/<div class="wikitext"><p>In general the "exact copy" thing has these options:</p>
<pre>
-a
-x don't cross filesystem boundaries.
-A ACLs too.
-X extended attributes too.
-H keep hard-links.
</pre>
<p>Somewhat less exact adds one or more of:</p>
<pre>
-O [optional] don't preserve directory modification times.
-J [optional] don't preserve symlink modification times.
--noatime [optional] do not change access time of source files.
--numeric-ids [optional] preserve owner and group numbers.
</pre>
<p>with <code>-OJ</code> directory and symlink times are not preserved exactly, but usually preserving them is pointless and expensive as is omitting <code>--noatime</code>. Sometimes <code>--numeric-ids</code> is more exact and sometimes it is not.</p>
</div>2022-02-16T20:56:44ZFrom 71.219.61.14 on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:a433b5956d27e6128c135baa16aa1c716d0db83cFrom 71.219.61.14<div class="wikitext"><p>Like other commentators here I've got my fingers hardwired to always use -Hav</p>
</div>2022-02-16T15:24:54ZBy Chris Siebenmann on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:240135f690522ba320c1c80b79687109896c14c4Chris Siebenmann<div class="wikitext"><p>I did indeed mean <code>-S</code>, not <code>-s</code>; for no good reason, I just assumed
that the short version of <code>--sparse</code> was lower case instead of upper
case. I've updated the entry, and thank you.</p>
<p>(rsync is like ls, it's a game of what short option isn't valid.)</p>
</div>2022-02-16T14:04:30ZBy Fazal Majid on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:73ecead4a8f79bfc3f38e53b25a0f877c54a95c6Fazal Majidhttps://majid.info/<div class="wikitext"><p>I have rsync -azvHC in muscle memory…</p>
</div>2022-02-16T10:49:38ZBy Albert on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:9a38b3153c6d8edfd36b41694e2bf5bb900680edAlbert<div class="wikitext"><p>For maximum reliability I always use -avzHAX.</p>
</div>2022-02-16T10:03:21ZBy Arnaud Gomes on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:7d9cd815e63dccbcbb549b9ce8c098bd149b1c23Arnaud Gomes<div class="wikitext"><p>My go-to rsync invocation includes <code>-aAXSH --numeric-ids</code>. Maybe add <code>-aP</code> and/or <code>--delete</code>, depending on the context.</p>
<pre>
-- A
</pre>
</div>2022-02-16T08:13:23ZBy Michael on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:b536b1c4ec1a590764d4e07444df81077890d402Michael<div class="wikitext"><p>I think you meant <code>-S</code> <code>(--sparse</code>), not <code>-s</code> <code>(--protect-args</code>).</p>
</div>2022-02-16T07:16:47ZBy Andrew Sh on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:db3e0eebaa7118bb475483c78895cf0140c023fdAndrew Sh<div class="wikitext"><p>The -A option may be important also.
Several good examples: <a href="https://wiki.archlinux.org/title/Rsync">https://wiki.archlinux.org/title/Rsync</a></p>
</div>2022-02-16T07:12:11ZBy cpu-chow on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:1b27e3f6a4d9867abe1baf8ffdced3c175854594cpu-chow<div class="wikitext"><p>The (xfs_)dump/restore utilities transfer whole filesystems faithfully, but not remotely as far as I am aware. I suppose you could improvise using full/incremental dumps and a clever socat or ssh incantation piping to remote (xfs_)restore, but if the remote destination is not static, or if you require two-way synch, all bets are off.</p>
<p>[hearty thanks for your delightfully arcane and thought-provoking blog]</p>
</div>2022-02-16T05:30:47ZBy Alex Xu (Hello71) on /blog/sysadmin/RsyncAndHardlinkstag:CSpace:blog/sysadmin/RsyncAndHardlinks:7bc755d1af6f56e38cb58ba122ed6028535a3444Alex Xu (Hello71)<div class="wikitext"><p>when copying a whole system, -X is also quite important. ping in particular may stop working when running non-root after it loses its file caps. on recent systemd distros this shouldn't be a huge issue due to ping_group_range, but on non-systemd or older systemd distros it may be confusing to receive permission denied errors when executing ping.</p>
</div>2022-02-16T02:33:07Z