Updated SQL

This commit is contained in:
netbenix 2021-11-28 12:33:22 +01:00
parent fcbaaa092f
commit 675a8dafb3
5 changed files with 32 additions and 21 deletions

View file

@ -21,15 +21,15 @@ func main(){
storage := StorageTypes.CheckStorageType(backupItem.StorageType)
destPath := checkTmpPath(config, backupItem.CreateLocalBackup)
bakFile := Compressor.CreateBakFile(backupItem.BackupName + getTimeSuffix(), backupItem.FolderPath, destPath)
bakFile := Compressor.CreateBakFile(backupItem.BackupName + getTimeSuffix(), backupItem.FolderPath, destPath, backupItem.BackupName)
fmt.Printf(bakFile)
StorageTypes.UploadFile(storage, bakFile)
StorageTypes.UploadFile(storage, bakFile, backupItem.BackupName)
if !backupItem.CreateLocalBackup {
_ = os.Remove(bakFile)
SQL.NewLogEntry(SQL.GetSQLInstance(), uuid.New(), SQL.LogInfo, backupItem.BackupName, SQL.SQLStage_DeleteTmp, SQL.REMOTE_NONE, "Deleted tmp file" ,time.Now())
}
SQL.NewBackupEntry(SQL.GetSQLInstance(), backupItem.BackupName, time.Now(), backupItem.CreateLocalBackup, backupItem.FolderPath, StorageTypes.CheckRemoteStorageType(backupItem.StorageType), StorageTypes.GetAzureStorage().TargetDirectory)
}
}