Last active
January 26, 2022 00:39
-
-
Save manishrjain/df84a0a9967c13604d34 to your computer and use it in GitHub Desktop.
rsync two local folders
This file contains 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
# rsync src folder to dest folder | |
# -r = recursive | |
# -t = preserves times | |
# -v = verbose | |
# -u = Instead of blind copy, check if file already exists, and update it | |
# -c = Skip files based on checksum, not mod-time & size (expensive) | |
# -a = Archive mode, preserves symbolic links (useful). | |
# -h = human mode | |
# --progress to show progress and ETA. | |
# | |
# trailing slashes are important because with them "src" folder doesn't get | |
# created inside dst folder, like so -> dst/src. Instead src/* -> dst/*. | |
rsync -rtvuc --delete src/ dst/ | |
# If sending data over network or between drives, also consider using | |
# -z option, which would compress data before transfer. | |
rsync -rtvucz --delete src/ -e ssh server:/dst/ | |
# Restart them in case of temporary network errors, until they exit | |
# successfully. | |
until !!; do :; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disk usage with ncdu.