0

I am currently configuring Dirvish on a Linux computer for backing up the contents of a share on a Windows computer.

Dirvish creates a new directory every time it is called. It internally uses rsync for copying data, creates hard links for files that have not changed and copies those that have.

Normally, from Linux to Linux, it uses rsync over ssh where rsync is running on both sides of the connection so for those files that already exist, only a checksum is transferred which is pretty much instant even for large files.

When used on a Samba share, there is no rsync on the other computer so does rsync still provide any advantage over plain copy where network traffic is concerned?

1 Answer 1

1

Why use rsync instead of cp?
First, I wanted to quote Tim Morgan, who wrote three arguments on his blog post a few years ago, favoring rsync over cp:

  • It can be canceled in the middle, and resumed later.
  • It can show a progress bar that (while not perfect) is great for large files or lots of files.
  • It will only copy the changed files and won’t clobber already existing directories of files at the target.

rsync uses by default less traffic than cp, even on samba shares
In terms of network traffic, cp always copies the file contents, while rsync doesn't. The default behavior of rsync (see man page) is that it checks the file size and modification date/time. If those two attributes are the same, rsync assumes that the file is unaltered. This also works on Samba shares. This behavior can be changed using the -c or --checksum flag, which forces rsync to always do the check based on the checksum.

rsync -c uses (a little bit) more traffic
If you use the -c flag with rsync, there is the overhead of sending the filelist, which rsync does, but cp doesn't, so I think (not tested) rsync had a (very!) little bit more overhead than cp if rsync is used with the -c flag.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .