summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@mechanus.net>2015-01-12 19:50:23 +0300
committerVon Random <von@mechanus.net>2015-01-12 19:50:23 +0300
commit175c7979f9d5d8ac91e61ce4f82f747f9b8d2531 (patch)
tree3d7270a5e803d29e6858fe23e8d759a174925a3e
parent4eaaf32b10f7f9db6998ff6983f500a19f4b5ead (diff)
fixes, rolling out into production
-rwxr-xr-xbackup.zsh7
1 files changed, 3 insertions, 4 deletions
diff --git a/backup.zsh b/backup.zsh
index 9b912be..ea3847f 100755
--- a/backup.zsh
+++ b/backup.zsh
@@ -72,8 +72,8 @@ function apply_config
fi
# set defaults and / or fail to run if something is missing
case $protocol in
- ('ftp'|'ftps') port=${remote_port:-$default_ftp_port}; test_remote_settings; return $?;;
- ('sftp'|'ssh') port=${remote_port:-$default_ssh_port}; test_remote_settings; return $?;;
+ ('ftp'|'ftps') port=${remote_port:-$default_ftp_port}; test_remote_settings; exit_code=$?; [[ $exit_code -ne 0 ]] && return $exit_code;;
+ ('sftp'|'ssh') port=${remote_port:-$default_ssh_port}; test_remote_settings; exit_code=$?; [[ $exit_code -ne 0 ]] && return $exit_code;;
('local') unset remote_port;;
(*) cfg_err 'protocol'; return 5;;
esac
@@ -82,7 +82,6 @@ function apply_config
('xz') compress_flag='J' ;;
('bz2') compress_flag='j' ;;
('gz') compress_flag='z' ;;
- ('') unset compress_flag; unset compress_format ;;
(*) err "$compress_format is not a valid value for the compression format option."; return 5;;
esac
if [[ -n $exclude_list ]]; then
@@ -123,7 +122,7 @@ function compress
fi
fi
# do the magic and spit to stdout
- tar -c$compress_flag $snapshot_option $snapshot_file $exclude_option $exclude_list --ignore-failed-read -C $src_basedir $src_basename
+ tar -C $src_basedir -c$compress_flag $snapshot_option $snapshot_file $exclude_option $exclude_list --ignore-failed-read $src_basename
}
# store to local or remote