#!/usr/local/bin/expect -f # sync's the web site from seth ws to www.inscoe.org exp_version -exit 5.0 if $argc!=1 { send_user "usage: filename\n" exit } set file "$argv.tar" set oldfile "oldinscoeweb.tar" # of course these have to be set correctly set user "xxxxxx@xxxxxxxxx@xxxxxxxxxx" set pass "xxxxxxx@xxxxxxxxxx" puts "file = $file" # do it #!/usr/local/bin/expect -f set timeout 60 spawn /bin/ftp cbisgate.cbis.com expect "Name*:" send "$user\r" expect "331 aftpd:" exec sleep 3 send "$pass\r" expect "ftp>" send "site exec createbackup.sh $oldfile" expect "ftp>" send "binary\r" expect "ftp>" send "hash\r" expect "ftp>" send "get $oldfile\r" expect "ftp>" send "put $file\r" expect "ftp>" send "site exec restorebackup.sh $file" expect "ftp>" exit "200*226*ftp>" close