mirror of
https://github.com/jbowdre/library-syncer.git
synced 2024-12-04 13:32:18 +00:00
handle files deleted at source
This commit is contained in:
parent
356a301f44
commit
693d93f649
1 changed files with 6 additions and 2 deletions
|
@ -10,7 +10,11 @@ fi
|
||||||
|
|
||||||
echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Sync sync starts NOW!"
|
echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Sync sync starts NOW!"
|
||||||
# sync
|
# sync
|
||||||
/usr/bin/rsync --bwlimit=${SYNC_MAX_BW:-0} -e "ssh -l syncer -p ${SYNC_PORT:-2222} -i /syncer/.ssh/id_syncer -o StrictHostKeyChecking=no" -av --exclude '*.json' $SYNC_PEER:/ /syncer/library
|
/usr/bin/rsync --progress --bwlimit=${SYNC_MAX_BW:-0} -e "ssh -l syncer -p ${SYNC_PORT:-2222} -i /syncer/.ssh/id_syncer -o StrictHostKeyChecking=no" -avh --stats --exclude '*.json' --exclude '.vSphere-HA' $SYNC_PEER:/ /syncer/library --delete || [ $? -eq 23 ] && true
|
||||||
|
|
||||||
|
# handle removed files / remove directories
|
||||||
|
grep '"files": \[\]' /syncer/library/*/item.json -l | xargs rm -f $1
|
||||||
|
find /syncer/library -type d -empty -delete
|
||||||
|
|
||||||
# generate content library manifest
|
# generate content library manifest
|
||||||
echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Generating content library manifest..."
|
echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Generating content library manifest..."
|
||||||
|
|
Loading…
Reference in a new issue