This commit is contained in:
2020-05-23 13:51:58 +00:00
parent 6f7f162de4
commit ff3946b2b0
4 changed files with 46 additions and 21 deletions

View File

@@ -171,16 +171,16 @@ namespace AyaNova.Util
/// <summary>
/// Get date of newest backup file or minvalue if not found
/// Get date of newest automatic backup file or minvalue if not found
///
/// </summary>
/// <returns></returns>
internal static DateTime MostRecentBackupFileDate()
internal static DateTime MostRecentAutomatedBackupFileDate()
{
DateTime LastBackup = DateTime.MinValue;
var BackupPath = UtilityFilesFolder;
foreach (string file in Directory.EnumerateFiles(UtilityFilesFolder, "*.backup"))
{
foreach (string file in Directory.EnumerateFiles(UtilityFilesFolder, "db-*.backup"))
{
var ThisFileTime = File.GetCreationTimeUtc(file);
if (ThisFileTime > LastBackup)
{
@@ -505,11 +505,11 @@ namespace AyaNova.Util
}
internal static void BackupAttachments(ILogger log = null)
internal static void BackupAttachments(string demandFileNamePrepend,ILogger log = null)
{
try
{
var AttachmentsBackupFile = $"at-{FileUtil.GetSafeDateFileName()}.zip";//presentation issue so don't use UTC for this one
var AttachmentsBackupFile = $"{demandFileNamePrepend}at-{FileUtil.GetSafeDateFileName()}.zip";//presentation issue so don't use UTC for this one
AttachmentsBackupFile = GetFullPathForUtilityFile(AttachmentsBackupFile);
System.IO.Compression.ZipFile.CreateFromDirectory(UserFilesFolder, AttachmentsBackupFile);