rsync in Expect script
#!/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/
精彩评论