/ Published in: Bash
Syncronize a local folder with a remote folder.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/bash REMOTE_FOLDER="/path/to/remote/folder/" LOCAL_FOLDER="/path/to/local/folder/" SSH_USER="user" SSH_HOST="remote-host" DRY="--dry-run" if [ "$1" == 'write' ]; then DRY=" " fi echo $DRY rsync $DRY -av -e ssh --exclude "CVS" --exclude ".svn" $SSH_USER@$SSH_HOST:$REMOTE_FOLDER $LOCAL_FOLDER