rsync 无法解释的错误并收到 SIGINT、SIGTERM 或 SIGHUP

Geo*_*oot 5 rsync batch

我创建了一个批处理脚本来备份我们的服务器:

#!/bin/bash

user=$1

# create user dir
ssh root@local.backup.tst -p 5774  mkdir -p /var/backup/server.tst/incremental/$user

# backup mail dir
rsync -rvz --del --rsh='ssh -p5774' /home/$user/imap root@local.backup.tst:/var/backup/server.tst/incremental/$user 

cd /home/$user/domains
ls -1 | while read -r domain
do
        sh /etc/pxl/backup/domain.sh $user $domain
done
Run Code Online (Sandbox Code Playgroud)

但是当我运行它时sh script.sh username它挂起。

首先我得到了sending incremental file list,然后就不再回应了。当我按 ctrl-C (中止脚本)时,输出会发生变化:

sync error: unexplained error (code 130) at rsync.c(543) [sender=3.0.7]
sending incremental file list
public_html/gh.html
public_html/index.php
public_html/cgi-bin/.htaccess
public_html/... (and so on)
Run Code Online (Sandbox Code Playgroud)

..但又挂起。当我再次按 ctrl-C 时,我得到:

rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(543) [sender=3.0.7]
Run Code Online (Sandbox Code Playgroud)

我在两侧安装了相同的版本(3.0.7,协议 30)。我已经读过这个主题,但这并不能解决我的问题。

有人知道这里出了什么问题吗?我该如何解决?先感谢您!

小智 1

问题可能是 rsync 在删除接收器上的文件时出现问题。尝试 --ignore-errors 看看是否是这种情况。