![使用 scp 检查复制是否失败](https://linux22.com/image/1452274/%E4%BD%BF%E7%94%A8%20scp%20%E6%A3%80%E6%9F%A5%E5%A4%8D%E5%88%B6%E6%98%AF%E5%90%A6%E5%A4%B1%E8%B4%A5.png)
我的代码是否可以验证文件是否被正确复制?
ssh -t root@$machine -x "sshpass -p 'ubuntu' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /home/MyFile.txt root@$address:~ "
ssh -t root@$machine -x "sshpass -p 'ubuntu' ssh -t root@$address -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -x 'cp MyFile.txt /etc/xx/MyFile.txt'"