Created
March 15, 2025 18:39
-
-
Save ussserrr/a79b2da86e5af6caecc933ff590cd33d to your computer and use it in GitHub Desktop.
Usage: ./rsync.sh /source/folder /destination
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
#!/usr/bin/env bash | |
# https://download.samba.org/pub/rsync/rsync.1 | |
# | |
# --archive: same as "-rlptgoD": | |
# -r: recurse into directories | |
# -l: copy symlinks as symlinks | |
# -p: preserve permissions | |
# -t: preserve modification times | |
# -g: preserve group | |
# -o: preserve owner (super-user only) | |
# -D: same as "--devices --specials" | |
# --devices: preserve device files (super-user only) | |
# --specials: preserve special files | |
rsync \ | |
--archive \ | |
--info=progress2 \ | |
--itemize-changes \ | |
--no-inc-recursive \ | |
--atimes \ | |
--open-noatime \ | |
--sparse \ | |
--delete \ | |
--human-readable --human-readable \ | |
--exclude='.DS_Store' \ | |
--exclude='._*' \ | |
"$1" "$2" | |
echo "rsync finished, syncing..." | |
sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment