Search This Blog

Thursday, August 18, 2011

Shell script for rsync with two folders in different computers


#!/usr/bin/expect -f
set username user
set password password


spawn rsync -arvuz ./ $username@127.0.0.1:~/tmp/simulation/
match_max 100000
expect "*?assword:*"
send -- "$password\r"
expect eof


spawn rsync -arvuz $username@127.0.0.1:~/tmp/simulation/ ./
match_max 100000
expect "*?assword:*"
send -- "$password\r"
expect eof


In this script, delete is not cared.

No comments:

Post a Comment

Blog Archive