maybe fix Backuppathtestfile can't be deleted #6965
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Apr 12, 2025 at 09:27 UTC
918e889b1af9e742b072e5166b33fb46230b8aef
1 file changed
+3
-2
db.js
+3
-2
@@ -3352,8 +3352,9 @@ module.exports.CreateDB = function (parent, func) {
3352
return;
3353
}
3354
}
3355
- const testFile = path.join(backupPath, (parent.config.settings.autobackup.backupname + ".test"));
3356
-
3355
+ const currentDate = new Date();
3356
+ const fileSuffix = currentDate.getFullYear() + '-' + padNumber(currentDate.getMonth() + 1, 2) + '-' + padNumber(currentDate.getDate(), 2) + '-' + padNumber(currentDate.getHours(), 2) + '-' + padNumber(currentDate.getMinutes(), 2);
3357
+ const testFile = path.join(backupPath, parent.config.settings.autobackup.backupname + fileSuffix + '.zip');
3358
try { fs.writeFileSync( testFile, "DeleteMe"); }
3359
catch (e) {
3360
//Unable to create file