Added option to skip config generation
This commit is contained in:
parent
d8b355fa69
commit
792b0922dd
@ -63,12 +63,13 @@ IS_REMOTE_SYNOLGY=0 # Set to 1 if the remote end is a Synology NAS
|
||||
OVERRIDE_CRONTAB=0 # Set to 1 to override the existing crontab file
|
||||
OVERRIDE_CONFIG=0 # Set to 1 to override the existing borgmatic configuration file
|
||||
OVERRIDE_REPOSITORY=0 # Set to 1 to override the existing backup repository
|
||||
SKIP_CONFIG=0 # Set to 1 to skip the borgmatic configuration
|
||||
|
||||
# constants
|
||||
readonly SCRIPT_NAME="Borgmatic Backup Setup Tool"
|
||||
readonly SCRIPT_AUTHOR="Zion Networks at admin@zion-networks.de"
|
||||
readonly SCRIPT_SUPPORT="admin@zion-networks.de"
|
||||
readonly VERSION="1.2.1"
|
||||
readonly VERSION="1.2.2"
|
||||
|
||||
# logging functions
|
||||
function inf {
|
||||
@ -474,6 +475,10 @@ while [[ $# -gt 0 ]]; do
|
||||
OVERRIDE_CONFIG=1
|
||||
shift
|
||||
;;
|
||||
-k|--skip-config)
|
||||
SKIP_CONFIG=1
|
||||
shift
|
||||
;;
|
||||
-r|--override-repository)
|
||||
OVERRIDE_REPOSITORY=1
|
||||
shift
|
||||
@ -491,11 +496,11 @@ while [[ $# -gt 0 ]]; do
|
||||
fi
|
||||
inf "Options:"
|
||||
inf " -a, --auto: Enable automatic, non-interactive mode"
|
||||
inf " -n, --no-upgrade: Skip package upgrades"
|
||||
inf " -d, --debug: Enable debug mode"
|
||||
inf " -f, --first-backup: Run the first backup after setup"
|
||||
inf " -o, --override-crontab: Override the existing crontab file"
|
||||
inf " -c, --override-config: Override the existing borgmatic configuration file"
|
||||
inf " -k, --skip-config: Skip the borgmatic configuration"
|
||||
inf " -r, --override-repository: Override the existing backup repository"
|
||||
inf " -s, --upgrade-required: Upgrade only required packages"
|
||||
inf " -u, --upgrade-all: Upgrade all installed packages"
|
||||
@ -898,9 +903,14 @@ fi
|
||||
|
||||
# check if borgmatic configuration file already exists and abort if $OVERRIDE_CONFIG is not set
|
||||
if [ -f $BORGMATIC_CONFIG_FILE ] && [ $OVERRIDE_CONFIG -ne 1 ]; then
|
||||
err "A borgmatic configuration file already exists at $BORGMATIC_CONFIG_FILE."
|
||||
err "Please remove the existing configuration file or use the --override-config option."
|
||||
exit 1
|
||||
if [ $SKIP_CONFIG -eq 1 ]; then
|
||||
wrn "Skipping borgmatic configuration setup."
|
||||
wrn "Please make sure you have set up the configuration file manually."
|
||||
else
|
||||
err "A borgmatic configuration file already exists at $BORGMATIC_CONFIG_FILE."
|
||||
err "Please remove the existing configuration file or use the --override-config option."
|
||||
exit 1
|
||||
fi
|
||||
elif [ -f $BORGMATIC_CONFIG_FILE ] && [ $OVERRIDE_CONFIG -eq 1 ]; then
|
||||
wrn "Existing borgmatic configuration file will be overridden!"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user