Skip to content

Instantly share code, notes, and snippets.

@evandonovan
Last active May 25, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evandonovan/699fcfb91c950a14debf48fb0193c63a to your computer and use it in GitHub Desktop.
Save evandonovan/699fcfb91c950a14debf48fb0193c63a to your computer and use it in GitHub Desktop.
#!/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