From 9a51c0ffedc99832a23b352cc09700ed4469fda4 Mon Sep 17 00:00:00 2001 From: martinhAllied <48500900+martinhAllied@users.noreply.github.com> Date: Fri, 17 Jan 2020 09:00:23 +1300 Subject: [PATCH] fileBaseName missing '_log'. Added. When log files are rotated the names of the new files are changed from something.log to be with something_log__date.log. However when those are searched for to check for deletion the base checked is something__ rather than something_log__. With this change delete_old() now checks for something_log__ --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 706c375..f4fc467 100644 --- a/app.js +++ b/app.js @@ -62,7 +62,7 @@ function get_limit_size() { function delete_old(file) { if (file === "/dev/null") return; - var fileBaseName = path.basename(file, '.log') + "__"; + var fileBaseName = path.basename(file, '.log') + "_log" + "__"; var dirName = path.dirname(file); fs.readdir(dirName, function(err, files) {