diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-04-17 22:45:27 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-04-17 22:45:27 -0300 |
commit | ea668fd692a932f5017f370baa7cefc54db68087 (patch) | |
tree | b7cf0ae05e6a2c2a0e334ec39b0ae1684efce174 /files/sync-media | |
parent | 20f71f19e928d3220ef0d9183e496b2018a10039 (diff) | |
download | puppet-backup-ea668fd692a932f5017f370baa7cefc54db68087.tar.gz puppet-backup-ea668fd692a932f5017f370baa7cefc54db68087.tar.bz2 |
Try to copy files to a remote at sync-media
Diffstat (limited to 'files/sync-media')
-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 |