From de44f55cb82cc2b0f3aeaae57744192d5ec6cd0b Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 28 Dec 2016 22:13:43 +0100 Subject: [PATCH] Updated some test paths --- dev/tests/conf/local.conf | 6 +- dev/tests/conf/max-exec-time.conf | 4 +- dev/tests/conf/pull.conf | 6 +- dev/tests/conf/push.conf | 6 +- dev/tests/conf/tmp.old.conf.tmp | 176 ++++++++++++++++++++++++++++++ 5 files changed, 187 insertions(+), 11 deletions(-) create mode 100644 dev/tests/conf/tmp.old.conf.tmp diff --git a/dev/tests/conf/local.conf b/dev/tests/conf/local.conf index 353582b..4cf53fa 100644 --- a/dev/tests/conf/local.conf +++ b/dev/tests/conf/local.conf @@ -23,14 +23,14 @@ BACKUP_TYPE=local ###### BACKUP STORAGE ## Storage paths of the backups (absolute paths of the local or remote system) -SQL_STORAGE="${HOME}/obackup-storage/sql" -FILE_STORAGE="${HOME}/obackup-storage/files" +SQL_STORAGE="${HOME}/obackup-storage/sql-local" +FILE_STORAGE="${HOME}/obackup-storage/files-local" ## Encryption ENCRYPTION=yes ## Backup encryption needs a temporary storage space in order to encrypt files before sending them (absolute paths of the local or remote system) -CRYPT_STORAGE="${HOME}/obackup-storage/crypt" +CRYPT_STORAGE="${HOME}/obackup-storage/crypt-local" ## GPG recipient (pubkey for this recipient must exist, see gpg2 --list-keys or gpg --list-keys GPG_RECIPIENT="John Doe" diff --git a/dev/tests/conf/max-exec-time.conf b/dev/tests/conf/max-exec-time.conf index a538238..c56bfda 100644 --- a/dev/tests/conf/max-exec-time.conf +++ b/dev/tests/conf/max-exec-time.conf @@ -153,7 +153,7 @@ PRESERVE_HARDLINKS=no RSYNC_COMPRESS=no ## Max execution time per file backup task. Soft is warning only. Hard is warning, stopping backup and processing next one one file list. Tilme is specified in seconds -SOFT_MAX_EXEC_TIME_FILE_TASK=2 +SOFT_MAX_EXEC_TIME_FILE_TASK=1000 HARD_MAX_EXEC_TIME_FILE_TASK=1000 ## Keep partial uploads that can be resumed on next run, experimental feature @@ -190,7 +190,7 @@ SMTP_PASSWORD= ## Max execution time of whole backup process. Soft max exec time generates a warning only. ## Hard max exec time generates a warning and stops the whole backup execution. SOFT_MAX_EXEC_TIME_TOTAL=1000 -HARD_MAX_EXEC_TIME_TOTAL=1000 +HARD_MAX_EXEC_TIME_TOTAL=1 ## Log a message every KEEP_LOGGING seconds just to know the task is still alive KEEP_LOGGING=1801 diff --git a/dev/tests/conf/pull.conf b/dev/tests/conf/pull.conf index e06b4d8..db8245a 100644 --- a/dev/tests/conf/pull.conf +++ b/dev/tests/conf/pull.conf @@ -27,10 +27,10 @@ SQL_STORAGE="${HOME}/obackup-storage/sql-pull" FILE_STORAGE="${HOME}/obackup-storage/files-pull" ## Encryption -ENCRYPTION=no +ENCRYPTION=yes ## Backup encryption needs a temporary storage space in order to encrypt files before sending them (absolute paths of the local or remote system) -CRYPT_STORAGE="${HOME}/obackup-storage/crypt" +CRYPT_STORAGE="${HOME}/obackup-storage/crypt-pull" ## GPG recipient (pubkey for this recipient must exist, see gpg2 --list-keys or gpg --list-keys GPG_RECIPIENT="John Doe" @@ -56,7 +56,7 @@ FILE_WARN_MIN_SPACE=1048576 ###### REMOTE ONLY OPTIONS ## In case of pulled or pushed backups, remote system URI needs to be supplied. -REMOTE_SYSTEM_URI="ssh://root@localhost:22/" +REMOTE_SYSTEM_URI="ssh://root@localhost:49999/" ## You can specify a RSA key (please use full path). If not defined, the default ~/.ssh/id_rsa will be used. See documentation for further information. SSH_RSA_PRIVATE_KEY="${HOME}/.ssh/id_rsa_local" diff --git a/dev/tests/conf/push.conf b/dev/tests/conf/push.conf index facd65d..5773e0a 100644 --- a/dev/tests/conf/push.conf +++ b/dev/tests/conf/push.conf @@ -27,10 +27,10 @@ SQL_STORAGE="${HOME}/obackup-storage/sql-push" FILE_STORAGE="${HOME}/obackup-storage/files-push" ## Encryption -ENCRYPTION=no +ENCRYPTION=yes ## Backup encryption needs a temporary storage space in order to encrypt files before sending them (absolute paths of the local or remote system) -CRYPT_STORAGE="${HOME}/obackup-storage/crypt" +CRYPT_STORAGE="${HOME}/obackup-storage/crypt-push" ## GPG recipient (pubkey for this recipient must exist, see gpg2 --list-keys or gpg --list-keys GPG_RECIPIENT="John Doe" @@ -56,7 +56,7 @@ FILE_WARN_MIN_SPACE=1048576 ###### REMOTE ONLY OPTIONS ## In case of pulled or pushed backups, remote system URI needs to be supplied. -REMOTE_SYSTEM_URI="ssh://root@localhost:22/" +REMOTE_SYSTEM_URI="ssh://root@localhost:49999/" ## You can specify a RSA key (please use full path). If not defined, the default ~/.ssh/id_rsa will be used. See documentation for further information. SSH_RSA_PRIVATE_KEY="${HOME}/.ssh/id_rsa_local" diff --git a/dev/tests/conf/tmp.old.conf.tmp b/dev/tests/conf/tmp.old.conf.tmp new file mode 100644 index 0000000..d2d408c --- /dev/null +++ b/dev/tests/conf/tmp.old.conf.tmp @@ -0,0 +1,176 @@ +#!/bin/bash + +###### Remote (or local) backup script for files & databases +###### (C) 2013 by Ozy de Jong (www.badministrateur.com) +##### obackup config file rev 2016121901 v2.1x + +## Backup identification, any string you want +INSTANCE_ID="really-old-config-file" +LOGFILE="" + +BACKUP_TYPE=pull + + +## General backup options +SQL_BACKUP=yes +FILE_BACKUP=yes + +## Local storage paths +SQL_STORAGE="${HOME}/obackup-storage/sql-old" +FILE_STORAGE="${HOME}/obackup-storage/files-old" +ENCRYPTION="no" +CRYPT_STORAGE="/home/storage/crypt" +GPG_RECIPIENT="Your Name used with GPG signature" +CREATE_DIRS="yes" + + + + +## Keep the absolute source path in your backup, eg: /your/backup/storage/the/remote/server/files +## You should leave this enabled if you use recursive directories backup lists or they'll all end in the same path. +KEEP_ABSOLUTE_PATHS=yes +## Generate an alert if backup size is lower than given value in Kb, useful for local mounted backups. +BACKUP_SIZE_MINIMUM=1024 +GET_BACKUP_SIZE="yes" + +## Generate an alert if local storage free space is lower than given value in Kb. +SQL_WARN_MIN_SPACE=1048576 +FILE_WARN_MIN_SPACE=1048576 + + +## If enabled, file backups will be processed with sudo command. See documentation for /etc/sudoers configuration ("find", "du" and "rsync" need to be allowed). Requiretty needs to be disabled. +SUDO_EXEC=no +## Paranoia option. Don't change this unless you read the documentation and still feel concerned about security issues. +RSYNC_EXECUTABLE=rsync + +## Remote options (will make backups of remote system through ssh tunnel, public RSA key need to be put into /home/.ssh/authorized_keys in remote users home directory) +REMOTE_SYSTEM_URI=ssh://root@localhost:22/ +SSH_RSA_PRIVATE_KEY=${HOME}/.ssh/id_rsa_local +SSH_PASSWORD_FILE="" + +## ssh compression should be used unless your remote connection is good enough (LAN) +SSH_COMPRESSION=yes +SSH_IGNORE_KNOWN_HOSTS="no" +RSYNC_REMOTE_PATH="" + + +## Check for connectivity to remote host before launching remote backup tasks. Be sure the hosts responds to ping. Failing to ping will skip current task. +REMOTE_HOST_PING=yes +## Check for internet access by pinging one or more 3rd party hosts before remote backup tasks. Leave empty if you don't want this check to be be performed. Failing to ping will skip current task. +REMOTE_3RD_PARTY_HOSTS="www.kernel.org www.google.com" + +## Databases options +SQL_USER=root +## Save all databases except the ones specified in the exlude list. Every found database will be backed up as separate task (see documentation for explanation about tasks) +DATABASES_ALL=yes +DATABASES_ALL_EXCLUDE_LIST="test;information_schema;zarafa_prod" +# Alternatively, you can specifiy a manual list of databases to backup separated by spaces +DATABASES_LIST="" +## Max backup execution time per DB task. Soft is warning only. Hard is warning, stopping backup task and processing next one. Time is specified in seconds +SOFT_MAX_EXEC_TIME_DB_TASK=3600 +HARD_MAX_EXEC_TIME_DB_TASK=7200 +MYSQLDUMP_OPTIONS="--opt --single-transaction" + +## Preferred sql dump compression. Can be set to xz, lzma or gzip. +## Generally, xz level 5 is a good compromise between cpu, memory hunger and compress ratio. Gzipped files are set to be rsyncable. +COMPRESSION_PROGRAM=xz +COMPRESSION_LEVEL=3 +## Dump compression should be done on remote side but can also be done locally to lower remote system usage (will take more bandwidth, check for ssh compression) +COMPRESSION_REMOTE=yes + +## Path separator. You can set whatever seperator you want in your directories list below. You may change this in case you have some esoteric filenames (try to use unconventional separators like | ). +PATH_SEPARATOR_CHAR=";" +RSYNC_OPTIONAL_ARGS="" +PRESERVE_PERMISSIONS="yes" +PRESERVE_OWNER="yes" +PRESERVE_GROUP="yes" +PRESERVE_EXECUTABILITY="yes" + + + + + +## File backup lists. Double quoted directory list separated by the $PATH_SEPARATOR_CHAR. Every directory will be processed as task (see documentation for explanation about tasks) +DIRECTORY_LIST="${HOME}/obackup-testdata/testData" +## Recurse directory list separated by the $PATH_SEPARATOR_CHAR. Will create a backup task per subdirectory (one level only), eg RECURSE_LIST="/home /var" will create tasks "/home/dir1", "/home/dir2", ... "/home/dirN", "/var/log", "/var/lib"... "/var/whatever" +RECURSIVE_DIRECTORY_LIST="${HOME}/obackup-testdata/testDataRecursive" +## You can optionally exclude directories from RECURSE_LIST tasks, eg on the above example you could exclude /home/dir2 by adding it to RECURSE_EXCLUDE_LIST +RECURSIVE_EXCLUDE_LIST="${HOME}/obackup-testdata/testDataRecursive/Excluded" +RSYNC_PATTERN_FIRST="include" +RSYNC_INCLUDE_PATTERN="" + + +## Be aware that every recurse list will have it's own root (exclude pattern is relative from /home/web for /home/web/{recursedir}) +RSYNC_EXCLUDE_PATTERN="*.ded" +RSYNC_INCLUDE_FROM="" +RSYNC_EXCLUDE_FROM="" + + +## Preserve ACLS. Make sure target FS can hold ACLs or you'll get loads of errors. +PRESERVE_ACL=no +## Preserve Xattr +PRESERVE_XATTR=no +COPY_SYMLINKS="yes" +KEEP_DIRLINKS="yes" +PRESERVE_HARDLINKS="no" + + + +## Let RSYNC compress file transfers. Do not use if you already enabled SSH compression. +RSYNC_COMPRESS=yes +## Max execution time per file backup task. Soft is warning only. Hard is warning, stopping backup and processing next one one file list. Tilme is specified in seconds +SOFT_MAX_EXEC_TIME_FILE_TASK=3600 +HARD_MAX_EXEC_TIME_FILE_TASK=7200 +PARTIAL="no" +DELETE_VANISHED_FILES="no" +DELTA_COPIES="yes" +BANDWIDTH="0" + + + + + +## Alert email adresses separated by a space character +DESTINATION_MAILS="your@mail.tld" +SENDER_MAIL="sender@example.com" +SMTP_SERVER="smtp.isp.tld" +SMTP_PORT="25" +SMTP_ENCRYPTION="none" +SMTP_USER="" +SMTP_PASSWORD="" + + + + + + + +## Max execution time of whole backup process. Soft is warning only. Hard is warning and stopping whole backup process. +SOFT_MAX_EXEC_TIME_TOTAL=30000 +HARD_MAX_EXEC_TIME_TOTAL=36000 +KEEP_LOGGING="1801" + + +## Backup Rotation in case you don't use a snapshot aware file system like zfs or btrfs to perform a snapshot before every backup +ROTATE_SQL_BACKUPS=yes +ROTATE_FILE_BACKUPS=yes + +ROTATE_SQL_COPIES=7 +ROTATE_FILE_COPIES=7 + + +## Commands that will be run before and / or after backup execution (remote execution will only happen if REMOTE_BACKUP is set to yes). Very usefull to initiate snapshots. +## Set max execution time to 0 if you want these commands not to get stopped, else set a value in seconds after which execution will be stopped. +LOCAL_RUN_BEFORE_CMD="" +LOCAL_RUN_AFTER_CMD="" + +REMOTE_RUN_BEFORE_CMD="" +REMOTE_RUN_AFTER_CMD="" + +MAX_EXEC_TIME_PER_CMD_BEFORE=0 +MAX_EXEC_TIME_PER_CMD_AFTER=0 +STOP_ON_CMD_ERROR="no" +RUN_AFTER_CMD_ON_ERROR="no" + + +