diff --git a/.vscode/launch.json b/.vscode/launch.json index b93e6d65..5f678d52 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -63,7 +63,7 @@ "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=300;", "AYANOVA_DATA_PATH": "c:\\temp\\ravendata", "AYANOVA_USE_URLS": "http://*:7575;", - //"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", + "AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", //"AYANOVA_REMOVE_LICENSE_FROM_DB":"true", //"AYANOVA_REPORT_RENDERING_TIMEOUT":"1", //"AYANOVA_REPORT_RENDER_API_URL_OVERRIDE": "http://localhost:7575", diff --git a/docs/8.0/ayanova/docs/ops-form-backup.md b/docs/8.0/ayanova/docs/ops-form-backup.md index e4be5dd8..fc963ae3 100644 --- a/docs/8.0/ayanova/docs/ops-form-backup.md +++ b/docs/8.0/ayanova/docs/ops-form-backup.md @@ -180,4 +180,4 @@ Attachment backups are `.zip` files and database backups are Postgress standard The Backup now menu option does exactly that: an on demand instant backup. This is useful for testing purposes or after large changes are made that you would like to ensure have been backed up. This will generate a manual backup that is not part of the normal automated backup process. -Note that this backup will cause older backups to be pruned (deleted) as per the [number of backups to keep](#number-of-backups-to-keep) setting. +Note that this backup will still cause older backups to be pruned (deleted) as per the [number of backups to keep](#number-of-backups-to-keep) setting. diff --git a/server/AyaNova/generator/CoreJobBackup.cs b/server/AyaNova/generator/CoreJobBackup.cs index b1777396..a99745f2 100644 --- a/server/AyaNova/generator/CoreJobBackup.cs +++ b/server/AyaNova/generator/CoreJobBackup.cs @@ -55,8 +55,8 @@ namespace AyaNova.Biz await JobsBiz.LogJobAsync(Guid.Empty, jobstartmessage); DateTime dtStartBackup = DateTime.Now; - log.LogDebug("Backup starting"); - var DemandFileNamePrepend = OnDemand ? "manual-" : string.Empty; + log.LogDebug("Backup starting"); + // var DemandFileNamePrepend = OnDemand ? "manual-" : string.Empty; //************* //DO DATA BACKUP //build command @@ -67,7 +67,8 @@ namespace AyaNova.Biz Npgsql.NpgsqlConnectionStringBuilder PostgresConnectionString = new Npgsql.NpgsqlConnectionStringBuilder(ServerBootConfig.AYANOVA_DB_CONNECTION); var DBNameParameter = $"--dbname=postgresql://{PostgresConnectionString.Username}:{PostgresConnectionString.Password}@{PostgresConnectionString.Host}:{PostgresConnectionString.Port}/{PostgresConnectionString.Database}"; - var DataBackupFile = $"{DemandFileNamePrepend}db-{FileUtil.GetSafeDateFileName()}.backup";//presentation issue so don't use UTC for this one + //var DataBackupFile = $"{DemandFileNamePrepend}db-{FileUtil.GetSafeDateFileName()}.backup";//presentation issue so don't use UTC for this one + var DataBackupFile = $"db-{FileUtil.GetSafeDateFileName()}.backup";//presentation issue so don't use UTC for this one DataBackupFile = FileUtil.GetFullPathForBackupFile(DataBackupFile); var BackupUtilityCommand = "pg_dump"; @@ -108,7 +109,7 @@ namespace AyaNova.Biz if (ServerGlobalOpsSettingsCache.Backup.BackupAttachments) { await JobsBiz.LogJobAsync(Guid.Empty, $"LT:Backup LT:Attachments"); - FileUtil.BackupAttachments(DemandFileNamePrepend); + FileUtil.BackupAttachments(); log.LogDebug("Backup of file attachments completed OK"); } diff --git a/server/AyaNova/util/FileUtil.cs b/server/AyaNova/util/FileUtil.cs index c93e9228..15aeb1c0 100644 --- a/server/AyaNova/util/FileUtil.cs +++ b/server/AyaNova/util/FileUtil.cs @@ -588,11 +588,11 @@ namespace AyaNova.Util } - internal static void BackupAttachments(string demandFileNamePrepend, ILogger log = null) + internal static void BackupAttachments(ILogger log = null) { try { - var AttachmentsBackupFile = $"{demandFileNamePrepend}at-{FileUtil.GetSafeDateFileName()}.zip";//presentation issue so don't use UTC for this one + var AttachmentsBackupFile = $"at-{FileUtil.GetSafeDateFileName()}.zip";//presentation issue so don't use UTC for this one AttachmentsBackupFile = GetFullPathForBackupFile(AttachmentsBackupFile); System.IO.Compression.ZipFile.CreateFromDirectory(ServerBootConfig.AYANOVA_ATTACHMENT_FILES_PATH, AttachmentsBackupFile);