1

I’m using rsync to transfer all the files from a folder to a remote machine. I usually have between 1 and 3 files, all around 1 Mb. I am using the following rsync command:

rsync -ac -Ph <local>/./ user@<remote>:<folder>

rsync seems to hang after all the files have been 100% sent (according to the progress reports); but, as far as I can tell, it usually returns eventually if I wait long enough. I typically wait for a while, interrupt with <ctl-c>, and rerun the rsync command, which then usually completes within a few seconds.

I’ve tried googling for information about rsync hanging, but none of the results appear to match my situation. I've also tried removing the -c (checksum) option, but this does not fix the problem.

I’m using rsync 3.0.9, protocol version 30, on Debian 7 Wheezy.

Potentially this is related to a similar issue asked about in this question regarding scp.

EDIT: with -vvv, I get the following:

// skipping some initial output...
calling match_sums <localfolderpath>/<filename>
<filename>
      32.77K   3%    0.00kB/s    0:00:00  
sending file_sum
false_alarms=0 hash_hits=0 matches=0
       1.01M 100%    9.95MB/s    0:00:00 (xfer#1, to-check=0/2)
sender finished <localfolderpath>/<filename>
generate_files phase=1
recv_files(.)
recv_files(test1h_trivialListener)

…and that’s where it hangs. I killed the process, and the remote folder was empty.

5
  • Put attention to the origin path:without a ~ in the beginning you will try to rsync the whole file system. I think you want something like: rsync <options> myhost:./ remote:where
    – Hastur
    Apr 3, 2015 at 5:40
  • Er...the directory paths I'm giving are absolute paths. This should be obvious from the fact that rsync only ever lists and transfers the files I'm expecting, and from the fact that I don't get permissions errors. Apr 3, 2015 at 15:05
  • It can be even related to a remote server jam cache swapping. It should be interesting to notice if this happens even if you force a remote sudo echo 3 > /proc/sys/vm/drop_caches and rsync before you start to do the rsync. Ps> Anything interesting when you add ` -vvv` option?
    – Hastur
    Apr 4, 2015 at 9:30
  • @Hastur I've edited the question to add some output from -vvv. I tried putting 3 in drop_caches; the first time I tried this, rsync completed in about 15 seconds, but on subsequent trials it seemed to take longer. I'm going to try doing time rsync ..... to an empty destination directory 6 times in a row to get some more solid data. What do you mean about doing an rsync before I start the "real" rsync? Apr 4, 2015 at 21:04
  • A bare misprint: i mean sudo echo 3 > /proc/sys/vm/drop_caches and sync. This synchronises files and frees memory on the computer on which is done. Since it seems you have problem with the second part of rsync i mean to run them on the remote server before to run rsync. If you have not enough right on the server try a simple sync. BTW: You can also add --stats to have some information more. Many possible reasons about why the remote writing is slow: can be busy the remote computer, disk error, slow device(USB), NFS destination path, rsync deamon (if using ::)...
    – Hastur
    Apr 5, 2015 at 6:26

0

You must log in to answer this question.

Browse other questions tagged .