case 4204

This commit is contained in:
2022-09-30 23:56:40 +00:00
parent 1b0c3322be
commit d07e1367c8

View File

@@ -326,9 +326,11 @@ namespace AyaNova.Util
internal static void DatabaseBackupCleanUp(int keepCount)
{
if (keepCount < 1) keepCount = 1;
//case 4204 prepended db and at with * to accomodate manual backups also being pruned
//Database backups
var BackupFileList = Directory.EnumerateFiles(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH, "db-*.backup");
var BackupFileList = Directory.EnumerateFiles(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH, "*db-*.backup");
if (BackupFileList.Count() > keepCount)
{
//sort, skip newest x (keepcount) delete the rest
@@ -341,7 +343,7 @@ namespace AyaNova.Util
}
//Attachment backups
BackupFileList = Directory.EnumerateFiles(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH, "at-*.zip");
BackupFileList = Directory.EnumerateFiles(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH, "*at-*.zip");
if (BackupFileList.Count() > keepCount)
{
//sort, skip newest x (keepcount) delete the rest
@@ -353,6 +355,8 @@ namespace AyaNova.Util
}
}
}
internal static long BackupFilesDriveAvailableSpace()