Limit max backups to settings only
This commit is contained in:
parent
7b51d94e1b
commit
8d2c84c6ef
|
@ -4134,7 +4134,7 @@ function backupSettings() {
|
|||
const backupFile = path.join(directories.backups, `settings_${generateTimestamp()}.json`);
|
||||
fs.copyFileSync(SETTINGS_FILE, backupFile);
|
||||
|
||||
let files = fs.readdirSync(directories.backups);
|
||||
let files = fs.readdirSync(directories.backups).filter(f => f.startsWith('settings_'));
|
||||
if (files.length > MAX_BACKUPS) {
|
||||
files = files.map(f => path.join(directories.backups, f));
|
||||
files.sort((a, b) => fs.statSync(a).mtimeMs - fs.statSync(b).mtimeMs);
|
||||
|
|
Loading…
Reference in New Issue