diff options
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 |