maybe fix Backuppathtestfile can't be deleted #6965

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2025-04-12 09:27:50 +01:00
parent 08430a5fa7
commit 918e889b1a

5
db.js
View File

@ -3352,8 +3352,9 @@ module.exports.CreateDB = function (parent, func) {
return;
}
}
const testFile = path.join(backupPath, (parent.config.settings.autobackup.backupname + ".test"));
const currentDate = new Date();
const fileSuffix = currentDate.getFullYear() + '-' + padNumber(currentDate.getMonth() + 1, 2) + '-' + padNumber(currentDate.getDate(), 2) + '-' + padNumber(currentDate.getHours(), 2) + '-' + padNumber(currentDate.getMinutes(), 2);
const testFile = path.join(backupPath, parent.config.settings.autobackup.backupname + fileSuffix + '.zip');
try { fs.writeFileSync( testFile, "DeleteMe"); }
catch (e) {
//Unable to create file