开发者

rsync in Expect script

开发者 https://www.devze.com 2023-01-26 18:02 出处:网络
#!/usr/bin/expect -f #set timeout 25 spawn rsync root@14.12.123.82:\'/usr/backups /usr/backup-scripts /root/test/\' /root/
     #!/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: $"
        开发者_StackOverflow社区#send "\$xxxxxx\n"
        #expect "\\$ $

What is wrong with the above script i get an error saying invalid rsync options


From man rsync, this is the new syntax for multiple files:

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

The old syntax you are using should still work in the command line, but try this in spawn:

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

精彩评论

暂无评论...
验证码 换一张
取 消