rsync suddenly hanging indefinitely during transfers

久未见 提交于 2019-12-02 17:58:07

I've been running into the same thing again and again and it seems to help if you drop the -v option (which is annoying if you need that output).

This happened to me when the remote device ran out of space. The error wouldn't show when --verbose option was used; turning that off yielded some STDERR output that explained that the remote device was out of space. When I freed some space, I was able to run rsync again with --verbose and everything went fine.

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 "

I am using openSUSE 13.2 Linux, rsync version 3.1.1-2.4.1.x86_64, and I experienced similar problems, doing an rsync between my laptop and an external hard disk, with the destination device definitively having enough free space.

I thought I got an improvement omitting option -v, but after 10 minutes it was hanging again: strace said: select(5, [], [4], [], {60, 0}) = 0 (Timeout)

And with "iotop" I counld see confirm that the rsync processes did no significant disk IO any more.

Neither removing the -v option nor limiting the bandwidth using --bwlimit fixed the problem.

Alex

Just had a similar problem while doing rsync from harddisk to a FAT32 USB drive. rsync froze already in less than a second in my case and did not react at all after that ... left it with CTRL+C.

Found out that the problem was a combination of usage of hardlinks on the harddisk and having FAT32 filesystem on the USB drive, which does not support hardlinks.

Formatting the USB drive with ext4 solved the problem for me.

I was having the same problem and it was because I was running out of memory during the rsync. Created a swap file and problem solved.

In my situation rsync was not actually failing.

I have regular server backups which transfers large files over 500GB+ and have --append-verify or --checkusm over ssh parameters specified.

What I have found upon analysis is that once the client side completes it's file checks then the server side checks start. Which means while the server is doing it's checks the client side will appear hanged and frozen - run htop on the server to rsync working away.

This is likely a non issue if rsync is run in deamon mode on the server and using the rsync protocol instead of ssh for transfers.

On related note, this very LONG wait would trigger SSH timeout and a rsync: connection unexpectedly closed (254 bytes received so far) [sender] error message, sollution is to add ClientAliveInterval 120 and ClientAliveCountMax 720 to /etc/ssh/sshd_config.

Most likely not "your" problem, but I stumbled upon this question when I was researching a similar behavior:

I'm observing "hanging" when the target site has too much io load. e.G. on one of my small business servers, when someone is resyncing his IMAP account and downloading large batchs of data and a backup job runs that writes his data.

In this situation I notice a steep drop in performance for rsync. Noticeable in a high load value in top on the target machine, even though CPU and Mem are fine.

Waiting for the process to finish has helped every time or interrupting and attempting the rsync at a later time again.

Fernando Campos

It also happens when the user on target machine has not write permissions on target folder.
You can try giving write permission to others target folder:

sudo chmod -R o+w /path/to/target-folder

Had rsync hanging issue on Ubuntu 16. None of the options above helped. The problem was in the source drive (external SSD) which suddenly became faulty. I tried several disk checks, but all of them stuck. Ended up rebooting the system and disk suddenly became accessible again.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!