Backup problemi
This commit is contained in:
parent
b6e4eee402
commit
49b8506f59
4 changed files with 5 additions and 19 deletions
|
|
@ -64,7 +64,6 @@ public class PlatformBackgroundWorker : PlatformDomainService, IPlatformBackgrou
|
|||
var LogPrefix = $"{Clock.Now:s}_{Worker.Name}: {{0}}";
|
||||
var DistributedLockName = Worker.Name;
|
||||
var backupPath = "";
|
||||
var backupDeleteAfterDays = Configuration.GetValue<int>("App:BackupDeleteAfterDays", 3);
|
||||
|
||||
//using (var scope = ServiceScopeFactory.CreateScope())
|
||||
|
||||
|
|
@ -127,20 +126,6 @@ public class PlatformBackgroundWorker : PlatformDomainService, IPlatformBackgrou
|
|||
var result = await SpRepository.CallSpAsync(Worker.AfterSp, Worker.DataSourceCode, null);
|
||||
Logger.LogInformation(LogPrefix, $"AfterSp çalıştırıldı. Sonuç: {result}");
|
||||
}
|
||||
|
||||
// Backup Worker için yedekleme işlemi ve eski yedeklerin silinmesi
|
||||
if (Worker.WorkerType == WorkerTypeEnum.BackupWorker)
|
||||
{
|
||||
var files = Directory.GetFiles(backupPath, "*.bak");
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
if (File.GetLastWriteTime(file) < DateTime.Now.AddDays(backupDeleteAfterDays))
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
"RedirectAllowedUrls": "https://dev.sozsoft.com,https://dev.sozsoft.com/authentication/callback",
|
||||
"AttachmentsPath": "/etc/api/mail-queue/attachments",
|
||||
"CdnPath": "/etc/api/cdn",
|
||||
"BaseDomain": "sozsoft.com"
|
||||
"BaseDomain": "sozsoft.com",
|
||||
"BackupPath": "/var/opt/mssql/backup"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"SqlServer": "Server=sql;Database=Sozsoft;User Id=sa;password=NvQp8s@l;Trusted_Connection=False;Encrypt=False;TrustServerCertificate=True;Connection Timeout=60;",
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
"AttachmentsPath": "/etc/api/mail-queue/attachments",
|
||||
"CdnPath": "/etc/api/cdn",
|
||||
"BaseDomain": "sozsoft.com",
|
||||
"BackupPath": "/var/opt/mssql/backup",
|
||||
"BackupDeleteAfterDays": 3
|
||||
"BackupPath": "/var/opt/mssql/backup"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"SqlServer": "Server=sql;Database=Sozsoft;User Id=sa;password=NvQp8s@l;Trusted_Connection=False;Encrypt=False;TrustServerCertificate=True;Connection Timeout=60;",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
"RedirectAllowedUrls": "http://localhost:4200,http://localhost:4200/authentication/callback",
|
||||
"AttachmentsPath": "C:\\Private\\Projects\\sozsoft-platform\\configs\\mail-queue\\attachments",
|
||||
"CdnPath": "C:\\Private\\Projects\\sozsoft-platform\\configs\\docker\\cdn",
|
||||
"Version": "1.0.5"
|
||||
"Version": "1.0.5",
|
||||
"BackupPath": "/var/opt/mssql/backup"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"SqlServer": "Server=localhost;Database=Sozsoft;User Id=sa;password=NvQp8s@l;Trusted_Connection=False;Encrypt=False;TrustServerCertificate=True;Connection Timeout=60;",
|
||||
|
|
|
|||
Loading…
Reference in a new issue