diff options
-rw-r--r-- | files/sync-media | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/files/sync-media b/files/sync-media index 4e98e12..ea1c430 100644 --- a/files/sync-media +++ b/files/sync-media @@ -166,4 +166,22 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then rsync -av --delete $CACHE/$folder/ $VOLUME/$MEDIA/$folder/ fi done +else + # Try to copy to a remote + for folder in `ls $CACHE`; do + if [ -d "$CACHE/$folder/.git/annex" ]; then + ( + if git remote | grep -q "^$DISK$"; then + cd $CACHE/$folder + git annex copy . --to $DISK + else + echo "No such remote $DISK" + fi + ) + else + REMOTE="$DISK.$DOMAIN" + echo "Syncing $VOLUME/$MEDIA/$folder..." + rsync -av --delete $CACHE/$folder/ $REMOTE:$CACHE/$folder/ + fi + done fi |