diff options
author | lookshe <github@lookshe.org> | 2017-03-28 10:07:38 +0200 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2017-03-28 10:07:38 +0200 |
commit | d007c2e3c54a7012af1e2576e61200b7d4dd3918 (patch) | |
tree | c8e5302945ee7b853fc6b844e3b37e91200167f3 /backup_db.sh | |
parent | aed0f66e7f60f343f5d486dbcf621253cdfabb30 (diff) |
check return from borg init
Diffstat (limited to 'backup_db.sh')
-rwxr-xr-x | backup_db.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/backup_db.sh b/backup_db.sh index 90b9b72..5a951b0 100755 --- a/backup_db.sh +++ b/backup_db.sh @@ -67,6 +67,7 @@ function check_borg_repo { repo="$1" serverdir="$2" usesamerepo="$3" + ret=0 if [ "$usesamerepo" = "yes" ] then repo_path="$userserver:$backupdir/$serverdir" @@ -79,7 +80,13 @@ function check_borg_repo { then # create repo if not exists $nice $borg_local_path init --remote-path "$borg_remote_path" --encryption "$borg_encryption" "$repo_path" + if [ $? -ne 0 ] + then + $echo "problem in borg init $repo" + ret=1 + fi fi + return $ret } # backup single dir with borg @@ -87,7 +94,11 @@ function backup_db { repo="$1" serverdir="$2" usesamerepo="$3" - check_borg_repo "$repo" "$serverdir" "$usesamerepo" + check_borg_repo "$repo" "$serverdir" "$usesamerepo" + if [ $? -ne 0 ] + then + return 1 + fi # to get backup.ignore work with relative paths we need to change the directory if [ "$usesamerepo" = "yes" ] then |