Skip to content

Instantly share code, notes, and snippets.

@thimslugga
Created February 7, 2025 10:56
Show Gist options
  • Save thimslugga/c0060897bfb9da47abbbe2e22de9148c to your computer and use it in GitHub Desktop.
Save thimslugga/c0060897bfb9da47abbbe2e22de9148c to your computer and use it in GitHub Desktop.
Remote Sync Scripts
!#/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