diff --git a/host_backup.conf.example b/host_backup.conf.example index ec586f5..5510689 100644 --- a/host_backup.conf.example +++ b/host_backup.conf.example @@ -2,7 +2,7 @@ ###### obackup - Local or Remote, push or pull backup script for files & mysql databases ###### (C) 2013-2016 by Orsiris de Jong (www.netpower.fr) -###### obackup v2.1x config file rev 2016083101 +###### obackup v2.1x config file rev 2016083102 ###### GENERAL BACKUP OPTIONS @@ -33,7 +33,7 @@ ENCRYPTION=no ENCRYPT_STORAGE=/home/storage/backup/crpyt ## GPG Public key path -ENCRYPT_PUBKEY=/root/.gpg/pubkey +ENCRYPT_PUBKEY=${HOME}/.gpg/pubkey ## Create backup directories if they do not exist CREATE_DIRS=yes @@ -59,7 +59,7 @@ FILE_WARN_MIN_SPACE=1048576 REMOTE_SYSTEM_URI="ssh://backupuser@remote.system.tld:22/" ## 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="/root/.ssh/id_rsa" +SSH_RSA_PRIVATE_KEY="${HOME}/.ssh/id_rsa" ## ssh compression should be used unless your remote connection is good enough (LAN) SSH_COMPRESSION=yes diff --git a/upgrade-v1.x-2.1x.sh b/upgrade-v1.x-2.1x.sh index efd0a5d..30efc18 100755 --- a/upgrade-v1.x-2.1x.sh +++ b/upgrade-v1.x-2.1x.sh @@ -64,9 +64,19 @@ function RewriteConfigFiles { sed -i'.tmp' 's/^BACKUP_FILES=/FILE_BACKUP=/g' "$config_file" sed -i'.tmp' 's/^LOCAL_SQL_STORAGE=/SQL_STORAGE=/g' "$config_file" sed -i'.tmp' 's/^LOCAL_FILE_STORAGE=/FILE_STORAGE=/g' "$config_file" + if ! grep "^ENCRYPTION=" "$config_file" > /dev/null; then sed -i'.tmp' '/^FILE_STORAGE=*/a\'$'\n''ENCRYPTION=no\'$'\n''' "$config_file" fi + + if ! grep "^ENCRYPT_STORAGE=" "$config_file" > /dev/null; then + sed -i'.tmp' '/^ENCRYPTION=*/a\'$'\n''ENCRYPT_STORAGE=/home/storage/backup/crypt\'$'\n''' "$config_file" + fi + + if ! grep "^ENCRYPT_PUBKEY=" "$config_file" > /dev/null; then + sed -i'.tmp' '/^ENCRYPT_STORAGE=*/a\'$'\n''ENCRYPTION='${HOME}/.gpg/pubkey'\'$'\n''' "$config_file" + fi + sed -i'.tmp' 's/^DISABLE_GET_BACKUP_FILE_SIZE=no/GET_BACKUP_SIZE=yes/g' "$config_file" sed -i'.tmp' 's/^DISABLE_GET_BACKUP_FILE_SIZE=yes/GET_BACKUP_SIZE=no/g' "$config_file" sed -i'.tmp' 's/^LOCAL_STORAGE_KEEP_ABSOLUTE_PATHS=/KEEP_ABSOLUTE_PATHS=/g' "$config_file" @@ -116,10 +126,6 @@ function RewriteConfigFiles { fi # Add new config values from v1.1 if they don't exist - if ! grep "^ENCRYPTION=" "$config_file" > /dev/null; then - sed -i'.tmp' '/^FILE_STORAGE=*/a\'$'\n''ENCRYPTION=no\'$'\n''' "$config_file" - fi - if ! grep "^CREATE_DIRS=" "$config_file" > /dev/null; then sed -i'.tmp' '/^ENCRYPTION=*/a\'$'\n''CREATE_DIRS=yes\'$'\n''' "$config_file" fi @@ -153,7 +159,7 @@ function RewriteConfigFiles { fi if ! grep "^RSYNC_PATTERN_FIRST=" "$config_file" > /dev/null; then - sed -i'.tmp' '/^LOGFILE=*/a\'$'\n''RSYNC_PATTERN_FIRST=include\'$'\n''' "$config_file" + sed -i'.tmp' '/^RECURSIVE_EXCLUDE_LIST=*/a\'$'\n''RSYNC_PATTERN_FIRST=include\'$'\n''' "$config_file" fi if ! grep "^RSYNC_INCLUDE_PATTERN=" "$config_file" > /dev/null; then