1. 程式人生 > >分發系統:自動同步文件腳本

分發系統:自動同步文件腳本

exp local nbsp blog rsync oca expect set txt

[[email protected] ~]# cat 4.expect
#!/usr/bin/expect set passwd "123456" spawn rsync -av /tmp/1.txt root@192.168.11.18:/tmp/ # 要求兩端都安裝 rsync expect { "yes/no" { send "yes\r" } "password:" { send "$passwd\r" } } expect eof
[[email protected] ~]# chmod a+x 4.expect 
[[email protected]
/* */ ~]# ./4.expect

分發系統:自動同步文件腳本