rsync

use rsync over SSH

rsync -a -essh /source/ user@dest-server:/dest/

rsync -a -essh user@source-server:/source/ /dest/

use rsync over SSH with compression and delete files in destination and show progress

  • -a : archive mode (include a lot of default common options, including preserving symlinks)
  • -z : compress
  • -v : verbose : show files
  • -e ssh : do rsync in ssh protocol
  • -P : show progess as files done/remaining files
  • –delete : delete files in the destination that are not anymore in the source
rsync -azvesshP --delete /source/ user@dest-server:/dest/

One advantage of rsync over scp is that it can copy only the changed files, so it is faster than scp. Also it can resume a transfer if it is interrupted.