Commit c07882e0 authored by Fjen Undso's avatar Fjen Undso
Browse files

seperate config from script

parent 32895de4
myftpdumper.conf
### system settings
# Absolute path to local backup directory
declare -r BACKUP_PATH=""
# Send mail to this address in case of any errors. No mail if empty.
declare -r ADMINMAIL=""
# Keep so many backups or all if 0
declare -r NUMBACKUPS=30
# Combine tables of a database in single file
declare -r USE_TAR=1
# Compression utility (like gzip, bzip2, xz, lzop), parameters allowed
# Disable compression if empty
declare -r COMPRESS="xz -T0"
# The umask that is used for the backup. Leave empty to keep unchanged
declare -r UMASK=0077
### MySQL settings
declare -r DB_HOST=""
declare -r DB_USER=""
declare -r DB_PASS=""
declare -r DB_EXCLUDE='^(?!(mysql|phpmyadmin|information_schema|performance_schema))'
### Remote server settings
# Type of ftp connection: ftp, ftps, sftp
# Leave empty to disable upload
declare -r FTP_TYPE=""
declare -r FTP_HOST=""
declare -r FTP_USER=""
declare -r FTP_PASS="" # if empty, ssh key with no password is required
declare -r FTP_PORT="" # empty for default
declare -r FTP_KEYFILE="" # ssh key for sftp, empty for default
declare -r FTP_DIR=""
declare -r FTP_NUMBACKUPS=90
### GPG settings
# GPG key ID used for encryption starting with "0x" (preferred)
# or passphrase for symmetric encryption or empty (no encryption).
declare -r GPG_KEYID=""
declare -r GPG_PASS=""
......@@ -7,51 +7,6 @@
# to an (s)ftp server. Backups can be compressed and encrypted.
################################################################################
#### BEGIN CONFIGURATION #######################################################
### system settings
# Absolute path to local backup directory
declare -r BACKUP_PATH=""
# Send mail to this address in case of any errors. No mail if empty.
declare -r ADMINMAIL=""
# Keep so many backups or all if 0
declare -r NUMBACKUPS=30
# Combine tables of a database in single file
declare -r USE_TAR=1
# Compression utility (like gzip, bzip2, xz, lzop), parameters allowed
# Disable compression if empty
declare -r COMPRESS="xz -T0"
# The umask that is used for the backup. Leave empty to keep unchanged
declare -r UMASK=0077
### MySQL settings
declare -r DB_HOST=""
declare -r DB_USER=""
declare -r DB_PASS=""
declare -r DB_EXCLUDE='^(?!(mysql|phpmyadmin|information_schema|performance_schema))'
### Remote server settings
# Type of ftp connection: ftp, ftps, sftp
# Leave empty to disable upload
declare -r FTP_TYPE=""
declare -r FTP_HOST=""
declare -r FTP_USER=""
declare -r FTP_PASS="" # if empty, ssh key with no password is required
declare -r FTP_PORT="" # empty for default
declare -r FTP_KEYFILE="" # ssh key for sftp, empty for default
declare -r FTP_DIR=""
declare -r FTP_NUMBACKUPS=90
### GPG settings
# GPG key ID used for encryption starting with "0x" (preferred)
# or passphrase for symmetric encryption or empty (no encryption).
declare -r GPG_KEYID=""
declare -r GPG_PASS=""
################################################################################
info() {
echo "INFO: $1"
}
......@@ -280,6 +235,16 @@ upload() {
fi
}
# get config
config_file=$(dirname $0)/"myftpdumper.conf"
if [[ $# -gt 0 ]]; then
config_file=$1
fi
if [[ ! -f "$config_file" ]]; then
echo -e "USAGE: $0 path/to/config \nOr myftpdumper.conf file in same directory" >&2
exit 1
fi
source "$config_file"
check_prerequisites
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment