gpt4 book ai didi

linux - 期望脚本中的rsync

转载 作者:太空宇宙 更新时间:2023-11-04 11:40:05 25 4
gpt4 key购买 nike

     #!/usr/bin/expect -f
#set timeout 25
spawn rsync root@14.12.123.82:'/usr/backups /usr/backup-scripts /root/test/' /root/
expect "root@14.12.123.82's password: $"
#send "\$xxxxxx\n"
#expect "\\$ $

上面的脚本有什么问题我得到一个错误说无效的rsync选项

最佳答案

来自man rsync,这是多文件的新语法:

rsync -av host:file1 :file2 host:file{3,4} /dest/

您使用的旧语法在命令行中应该仍然有效,但请在 spawn 中试试这个:

spawn rsync root@14.12.123.82:/usr/backups :/usr/backup-scripts :/root/test/ /root/

关于linux - 期望脚本中的rsync,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4277795/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com