简体   繁体   English

使用RSYNC处理错误

[英]Error handling with RSYNC

What would be the simplest way to check if a remote SSH rsync fails from the host? 检查远程SSH rsync是否从主机失败的最简单方法是什么?

I don't care if the file couldn't be found, if a connection couldn't be established, or if RSYNC's dog died and had to attend its funeral. 我不在乎是否找不到该文件,是否无法建立连接,或者RSYNC的狗是否死亡并必须参加其葬礼。 How would I specify: 我将如何指定:

if RSYNC fails, do something? 如果RSYNC失败,该怎么办?

EDIT: RSYNC SSH not Daemon. 编辑:RSYNC SSH不是守护程序。

you could create a bash script, such as: 您可以创建一个bash脚本,例如:

if ssh <server> rsync; then
    echo "SUCCESS"
else
    echo "FAIL"
fi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM