Ensure we keep at least one backup on cleanup
If for some reason backups fail for longer than the retention time we should at least keep the latest around
This commit is contained in:
@@ -437,6 +437,9 @@ function cleanup(callback) {
|
||||
getPaged(1, 1000, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
// ensure we keep at least the last backup to ensure we have one if backup creation failed for some reason
|
||||
result = result.slice(1);
|
||||
|
||||
var now = new Date();
|
||||
|
||||
async.eachSeries(result, function iterator(backup, iteratorDone) {
|
||||
|
||||
Reference in New Issue
Block a user