Skip to content

Instantly share code, notes, and snippets.

@evandonovan
Last active May 25, 2016 15:19
Embed
What would you like to do?
#!/usr/bin/expect -f
# exp_internal 1 ;# uncomment to turn on expect debugging
set timeout -1
USER="user"
HOST="127.0.0.1"
SRC="/src/dir/here"
DST="/dst/dir/here"
# creates an rsync process that will rsync with excluded directories
# goes to source and destination
spawn rsync -e "ssh -p 22" -aPH --exclude='/moodledata' --exclude='/backup' $USER@$HOST:$SRC $DST
expect "password:"
send "password\r"
expect eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment