aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-09-30 19:31:06 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-09-30 19:31:06 -0300
commitfb46564dc1c5f834868582b24c4f1ae4dae78501 (patch)
treec1e84f6078d09c30f27d5237039bf5c576ca495e
parent985de3e83c2af6d08c78d98045130984302ba7dc (diff)
downloadhydra-fb46564dc1c5f834868582b24c4f1ae4dae78501.tar.gz
hydra-fb46564dc1c5f834868582b24c4f1ae4dae78501.tar.bz2
Feat: hydractl: sync-media: enhanced rsync support with multiple methods
-rwxr-xr-xshare/hydractl/sync-media8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media
index d463e44..1ce9516 100755
--- a/share/hydractl/sync-media
+++ b/share/hydractl/sync-media
@@ -274,7 +274,13 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
if [ "$method" == "unison" ];
unison $CACHE/$folder $VOLUME/$MEDIA/$folder -auto -logfile /dev/null
- elif [ "$method" == "rsync" ]; then
+ elif [ "$method" == "rsync-to-media-volume" ]; then
+ echo "Syncing $CACHE/$folder into $VOLUME/$MEDIA/$folder..."
+ rsync -av --delete --exclude=.sync-media $CACHE/$folder/ $VOLUME/$MEDIA/$folder/
+ elif [ "$method" == "rsync-from-media-volume" ]; then
+ echo "Syncing $VOLUME/$MEDIA/$folder into $CACHE/$folder..."
+ rsync -av --delete --exclude=.sync-media $VOLUME/$MEDIA/$folder/ $CACHE/$folder/
+ elif [ "$method" == "rsync-if-empty-dest" ]; then
# Ensure both endpoint folders exist
mkdir -p $CACHE/folder
mkdir -p $VOLUME/$MEDIA/$folder