Am Sun, Apr 03, 2022 at 09:59:22AM +0100 schrieb Wols Lists:
> On 03/04/2022 02:15, Bill Kenworthy wrote:
> > Rsync has a bwlimit argument which helps here. Note that rsync copies
> > the whole file on what it considers local storage (which can be mounted
> > network shares) ... this can cause a real slowdown.
> 
> It won't help on the initial copy, but look at the - I think it is -
> --in-place option.

This one is mostly useful if space on the destination is tight or the data
link (for FS commands) is slooow, because normally rsync creates a new temp
file and moves it into place once the transfer is complete. This to ensure
you never lose data due to a broken connection. If space is tight you could
also consider --delete-before instead, to first do all deletions before
copying the new stuff.

> It won't help with the "read and compare", but it only writes what has
> changed, so if a big file has changed slightly, it'll stop it re-copying the
> whole file.

I think you mean the -c (or --checksum) option, which causes rsync to read
the source and destination file (if both exist) in order to determine
whether the source has changed. In normal use cases, this should not be
necessary, as the file’s metadata (timestamps, permissions, inode numbers)
are enough for that.

As long as you don’t use -c, rsync is very quick at finding changed files.

My standard command is rsync -ai --delete, wich does what most people™ need
(-a/--archive means to copy all time stamps, permissions and owner, and -i
shows what rsync does and why it does it). In some special cases, I include
-x to not cross file systems (like when archiving /), or -H for hard links.
I don’t deliberately use extended attributes, for which -X is your friend.

-- 
Grüße | Greetings | Salut | Qapla’
Please do not share anything from, with or about me on any social network.

“Don’t put multiple statements on a single line unless you have something
to hide.” – Linus Torvalds, Linux kernel coding style documentation

Attachment: signature.asc
Description: PGP signature

Reply via email to