Created
February 7, 2025 10:56
-
-
Save thimslugga/c0060897bfb9da47abbbe2e22de9148c to your computer and use it in GitHub Desktop.
Remote Sync Scripts
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/bash | |
SRC_DIR=/Volumes/storage/Media/Movies | |
DST=rsync://<server>:30026/movies | |
EXCLUDE_FILE=.rsync_exclude | |
if [ "$1" == "test" ]; then | |
RSYNC_START="/opt/homebrew/bin/rsync --dry-run" | |
else | |
RSYNC_START="/opt/homebrew/bin/rsync" | |
fi | |
if [ ! -d $SRC_DIR ]; then | |
echo "local source directory does not exist. Please fix and try again" | |
else | |
$RSYNC_START \ | |
--iconv=utf-8-mac,utf-8 \ | |
--force \ | |
--inplace \ | |
--size-only \ | |
--no-perms \ | |
--no-owner \ | |
--no-group \ | |
--omit-dir-times \ | |
--delete \ | |
--progress \ | |
--stats \ | |
--recursive \ | |
--exclude-from=$EXCLUDE_FILE \ | |
$SRC_DIR \ | |
$DST | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment