diff --git a/README.md b/README.md index 55b0b6b..794faa2 100644 --- a/README.md +++ b/README.md @@ -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 | \ No newline at end of file diff --git a/main.go b/main.go index 4e15540..5f590a0 100644 --- a/main.go +++ b/main.go @@ -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) } }