Merge pull request #17 from netbenix/develop

Minor fixes
This commit is contained in:
netbenix 2021-12-23 13:17:11 +01:00 committed by GitHub
commit 5981aa5f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -57,5 +57,6 @@ Trello board: [Click me!](https://trello.com/b/6zWLE6Jm)
| backupName | string | .bak file name |
| folderPath | string | Path to folder which should be backed up |
| remoteStorageType | string | See [StorageTypes](#storage-types) |
| targetPath | string | Sets the targetPath for local backups |
| remoteTargetPath | string | Sets the remotePath for remote backups |
| localTargetPath | string | Sets the targetPath for local backups |
| createLocalBackup | boolean | Sets if .bak file should also be saved locally |

View file

@ -36,6 +36,8 @@ func main(){
}
if !backupItem.CreateLocalBackup && backupItem.RemoteStorageType != "none"{
backupItem.LocalTargetPath = "NONE"
_ = os.Remove(bakFile)
SQL.NewLogEntry(SQL.GetSQLInstance(), uuid.New(), SQL.LogInfo, backupItem.BackupName, SQL.SQLStage_DeleteTmp, SQL.REMOTE_NONE, "Deleted tmp file" ,time.Now())
}
@ -44,7 +46,7 @@ func main(){
backupItem.CreateLocalBackup = true
backupItem.RemoteTargetPath = "NONE"
}
SQL.NewBackupEntry(SQL.GetSQLInstance(), backupItem.BackupName, time.Now(), backupItem.CreateLocalBackup, backupItem.FolderPath, StorageTypes.CheckRemoteStorageType(backupItem.RemoteStorageType), backupItem.RemoteTargetPath, backupItem.LocalTargetPath)
SQL.NewBackupEntry(SQL.GetSQLInstance(), backupItem.BackupName, time.Now(), backupItem.CreateLocalBackup, backupItem.FolderPath, StorageTypes.CheckRemoteStorageType(backupItem.RemoteStorageType), backupItem.RemoteTargetPath, backupItem.LocalTargetPath)
}
}