Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rsync suddenly hanging indefinitely during transfers

Tags:

macos

rsync

nas

For the past few years, I have been using an rsync one-liner to back up important folders on my Mac Mini desktop (OSX 10.9, 2.5 GHz i5, 4 GB RAM) to a FreeNAS box (0.7.2 Sabanda revision 5266, Pentium D 2.66 GHz, 822MiB RAM [reported by the system, I think there's 1 GB in there]). I am running an rsync daemon on the FreeNAS box. Recently, these transfers have been hanging indefinitely. I have done the usual Google-fu and am unable to identify the source of the problem or a solution.

The one-liner is:

rsync -rvOlt --exclude '.DS_Store'                                  \       --exclude '.com.apple.timemachine.supported'                  \       --delete /Volumes/Storage/Music/Albums/ 192.168.1.100::albums 

I have tried enabling -vvv and --progress, but there is no pattern that I can discern between what hangs and what doesn't. Heck, if I retry, the same file might hang at a different point during the transfer or not at all. A dry run (-n) does not always succeed either. The only "success" I've had is implementing a timeout (--timeout=10) and rerunning the command over and over. Eventually, I creep along, but with no guarantee of success and at a pace that is unacceptable. I've reached a point where I have one file that I can't get past.

The Mac Mini is connected to my router via 5 GHz. The FreeNAS box is wired into that same router on a 100 mbit port. When transfers are actually going, rsync --progress reports 2.5-4 MB/s. According to --progress, a hang is literally just that—no data transfer is occurring as far as I can tell.

I need help with both the diagnostics and the solution.

like image 610
Matthew DeNardo Avatar asked Dec 25 '13 13:12

Matthew DeNardo


People also ask

Why does rsync get stuck?

Sometimes the Rsync command hangs on large files due to the usage of wrong options with Rsync too. This becomes applicable in scenarios where we need to transfer large files with a slow network connection. So we suggest to our customers to try it with the -z option 'compress file data during the transfer'.

How do I know rsync is done?

Method 1: Using –progress option to see the rsync progress:Use the “–progress” in the rsync command and “-av” to get a summary at the end of file transfer, consisting of transfer rate, sent/receive bytes, speed of transfer, and total file size.

Does rsync take a long time?

The volume of used disk space on a server determines rsync times. That is, the more data to copy, the longer the job takes. Typically, an empty OS rsync takes 10-15 minutes to complete.

Can rsync be interrupted?

If transfer is interrupted this is a truncated file. --partial By default, rsync will delete any partially transferred file if the transfer is interrupted. In some circumstances it is more desirable to keep partially transferred files.


1 Answers

I was having the same problem. Removing -v didn't work for me. My use-case is slightly different in that I'm going from source (EXT4) to ExFAT. The issue for me was that rsync was attempting to preserve device files and permissions, which ExFAT doesn't support. I was using the -hrltDvaP switches. The -D and -a switches seemed to be my problem. The -a switch translates to -rlptgoD (no -H,-A,-X). The -p, -g, and -o switches seemed to be my root cause as rsync was barfing on one or all of those during runtime. Removing -a and specifying -Prltvc switches explicitly is working for me.

bkupcmd="nice -n$nicelevel /usr/bin/rsync -Prltvc --exclude-from=/var/tmp/ignorelist " 
like image 73
Jim Avatar answered Sep 28 '22 06:09

Jim