From 08360cd91bbac9487df33d72e2057ec3e423deb0 Mon Sep 17 00:00:00 2001 From: alse Date: Mon, 8 Jun 2020 15:43:52 +0530 Subject: [PATCH] Adding a callback for logging error on deleting backup --- restore.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/restore.js b/restore.js index 859076c..7864028 100644 --- a/restore.js +++ b/restore.js @@ -14,5 +14,12 @@ exports.crontabs = function(db_name, callback){ }; exports.delete = function(db_name){ - fs.unlink(__dirname + '/crontabs/' + db_name); + fs.unlink(__dirname + '/crontabs/' + db_name, function(err){ + if(err) { + return console.log("Delete error: " + err); + } + else{ + console.log("Backup deleted"); + } + }); };