Skip to content

Instantly share code, notes, and snippets.

@allaryin
Last active April 19, 2016 16:45
Show Gist options
  • Save allaryin/f9614cc7e89908a15523fa7e4d09698c to your computer and use it in GitHub Desktop.
Save allaryin/f9614cc7e89908a15523fa7e4d09698c to your computer and use it in GitHub Desktop.
Nice directory rsync
#!/bin/sh
BWLIMIT=1024
if [ ! -d "$1" -o ! -d "$2" ]; then
echo "$0 <orig dir> <new dir>"
exit 1
fi
SRC=`realpath "${1}"`/
DST=`realpath "${2}"`
set -x
rsync --progress --inplace --human-readable --stats -avz --bwlimit=${BWLIMIT} "${SRC}" "${DST}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment