Skip to content

Commit

Permalink
Adds wrapper for DoBackup Silent
Browse files Browse the repository at this point in the history
  • Loading branch information
azak-azkaran committed Mar 15, 2021
1 parent 09e5414 commit c20880d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ func DoBackupVerbose(token string, mode string) error {
return DoBackup(token, mode, true, false,false,true)
}

func DoBackupSilent(token string, mode string) error {
return DoBackup(token, mode, false, false,false,true)
}

func DoBackup(token string, mode string, printOutput bool, debug bool, test bool, run bool) error {
config, err := CreateConfigFromVault(token, AgentConfiguration.Hostname, AgentConfiguration.VaultConfig)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func CheckBackupRepository() {
if now.After(t) {
BackupRepositoryExists(token)

err := DoBackupVerbose(token, "check")
err := DoBackupSilent(token, "check")
if err != nil {
Sugar.Error(err)
return
Expand Down Expand Up @@ -233,7 +233,7 @@ func backup() {
}

func BackupRepositoryExists(token string) {
err := DoBackup(token, "exist", true, false, false, true)
err := DoBackupSilent(token, "exist")
if err == nil {
return
}
Expand Down

0 comments on commit c20880d

Please sign in to comment.