diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-09-30 19:31:06 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-09-30 19:31:06 -0300 |
commit | fb46564dc1c5f834868582b24c4f1ae4dae78501 (patch) | |
tree | c1e84f6078d09c30f27d5237039bf5c576ca495e | |
parent | 985de3e83c2af6d08c78d98045130984302ba7dc (diff) | |
download | hydra-fb46564dc1c5f834868582b24c4f1ae4dae78501.tar.gz hydra-fb46564dc1c5f834868582b24c4f1ae4dae78501.tar.bz2 |
Feat: hydractl: sync-media: enhanced rsync support with multiple methods
-rwxr-xr-x | share/hydractl/sync-media | 8 |
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 |