oldjamey
6/19/2013 - 8:04 PM

recursive rsync over ssh on non-standard port, with update, compression, progress bars, and more.

recursive rsync over ssh on non-standard port, with update, compression, progress bars, and more.

#!/bin/bash

# -a -- recursive, preserving date/time/ownership (`man rsync`)

# -u -- update (only replace/add files that are newer or non-existent on the target)

# -v -- verbose output

# -z -- compression

# --progress -- show progress bar with current transfer status

# -e -- execute command

rsync -auvz --progress [local source directory] -e "ssh -p [port]" user@ip:/path/to/target/directory/