Created
December 12, 2018 11:00
-
-
Save teolaz/90be8200ea1d44bba0a2b52d37be4872 to your computer and use it in GitHub Desktop.
Rsync to a remote server seeing percentage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "rsync starting..." | |
SOURCE_DIR="/source/dir/with/final/backslash/" | |
TARGET_ADDRESS="127.0.0.1" | |
TARGET_DIR="/dir/with/final/backslash/" | |
TARGET_USER="remote-ssh-user" | |
RSYNC_ARGS='-vrltD --delete --stats --human-readable' | |
TODO=$(find ${SOURCE_DIR} | wc -l) | |
echo "found ${TODO} files, syncing..." | |
rsync ${RSYNC_ARGS} ${SOURCE_DIR} ${TARGET_USER}@${TARGET_ADDRESS}:${TARGET_DIR} | pv -l -e -p -s "$TODO" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment