aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-11 15:02:46 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-11 15:02:46 -0300
commitd3bf36a9762c84e41ba2f5c388424685e2aa5f86 (patch)
tree61bdf953c931b2d48ddb19624cbccb6fc5c7ee99
parent3114ea4058ca7d26a78b24f84a8e5d9ea9f343cf (diff)
downloadpuppet-backup-d3bf36a9762c84e41ba2f5c388424685e2aa5f86.tar.gz
puppet-backup-d3bf36a9762c84e41ba2f5c388424685e2aa5f86.tar.bz2
Support for .sync-media-skip at sync-media
-rw-r--r--files/sync-media18
1 files changed, 12 insertions, 6 deletions
diff --git a/files/sync-media b/files/sync-media
index 1f1684f..6fba114 100644
--- a/files/sync-media
+++ b/files/sync-media
@@ -142,8 +142,10 @@ if [ -d "$CACHE" ]; then
)
fi
elif [ ! -d "$VOLUME/$MEDIA/$folder" ]; then
- echo "Syncing $VOLUME/$MEDIA/$folder..."
- rsync -av --delete $CACHE/$folder/ $VOLUME/$MEDIA/$folder/
+ if [ ! -e "$CACHE/$folder/.sync-media-skip" ]; then
+ echo "Syncing $VOLUME/$MEDIA/$folder..."
+ rsync -av --delete $CACHE/$folder/ $VOLUME/$MEDIA/$folder/
+ fi
fi
done
fi
@@ -185,8 +187,10 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
#git annex drop --auto --numcopies=2
)
elif [ -d "$CACHE/$folder" ]; then
- echo "Syncing $VOLUME/$MEDIA/$folder..."
- rsync -av --delete $CACHE/$folder/ $VOLUME/$MEDIA/$folder/
+ if [ ! -e "$CACHE/$folder/.sync-media-skip" ]; then
+ echo "Syncing $VOLUME/$MEDIA/$folder..."
+ rsync -av --delete $CACHE/$folder/ $VOLUME/$MEDIA/$folder/
+ fi
fi
done
elif [ ! -z "$REMOTE" ]; then
@@ -207,8 +211,10 @@ elif [ ! -z "$REMOTE" ]; then
echo "No such remote $REMOTE"
fi
else
- echo "Syncing $VOLUME/$MEDIA/$folder..."
- rsync -av --delete $CACHE/$folder/ $REMOTE.$DOMAIN:$CACHE/$folder/
+ if [ ! -e "$CACHE/$folder/.sync-media-skip" ]; then
+ echo "Syncing $VOLUME/$MEDIA/$folder..."
+ rsync -av --delete $CACHE/$folder/ $REMOTE.$DOMAIN:$CACHE/$folder/
+ fi
fi
done
fi