Thursday, November 10, 2011

Deploying code with rsync

I use rsync to deploy code to my web server:

rsync --recursive --compress \
        --verbose --progress --stats \
        --times --perms --delete \
        --exclude "*~" --exclude "*.pyc"  \
        . login@server:path

This command will transfer the current directory and all sub-directories and files to my server, but only transfer modified files to save time and bandwidth.
verbose, progress, and stats display useful output
times / perms ensure the file timestamps / permissions are the same on my server
delete will delete remote files when deleted locally
exclude temporary files

No comments: