Prevent error when there are no Mongo backups to remove yet.
This commit is contained in:
@@ -22,6 +22,7 @@ cd $BACKUPDIR
|
||||
tar -Jcf $ARCHIVE dump-$DATE/
|
||||
rm -rf dump-$DATE
|
||||
|
||||
rm -v $(ls $BACKUPDIR/mongo-live-*.tar.xz | head -n -7)
|
||||
TO_DELETE="$(ls $BACKUPDIR/mongo-live-*.tar.xz | head -n -7)"
|
||||
[ -z "$TO_DELETE" ] || rm -v $TO_DELETE
|
||||
|
||||
rsync -4 -va $BACKUPDIR/mongo-live-*.tar.xz cloud-backup@swami-direct.blender.cloud:/data/cloud-backup/
|
||||
|
Reference in New Issue
Block a user