Backup type

This commit is contained in:
Bob Mottram 2015-09-13 14:14:10 +01:00
parent 04d392eb44
commit 179b3d1adb
1 changed files with 22 additions and 18 deletions

View File

@ -219,6 +219,9 @@ UPGRADE_SCRIPT_NAME="freedombone-upgrade"
# name of a script which keeps running processes going even if they crash
WATCHDOG_SCRIPT_NAME="keepon"
# the type of backup system used
BACKUP_TYPE='rsync'
# Name of a script used to create a backup of the system on usb drive
BACKUP_SCRIPT_NAME="backup"
@ -776,6 +779,9 @@ function read_configuration {
fi
if [ -f $CONFIGURATION_FILE ]; then
if grep -q "BACKUP_TYPE" $CONFIGURATION_FILE; then
BACKUP_TYPE=$(grep "BACKUP_TYPE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "TRACKER_PORT" $CONFIGURATION_FILE; then
TRACKER_PORT=$(grep "TRACKER_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
@ -2409,8 +2415,6 @@ function get_mariadb_owncloud_admin_password {
fi
}
BACKUP_TYPE='rsync'
function backup_directory_to_usb {
if [[ $BACKUP_TYPE == 'rsync' ]]; then
echo "rsyncrypto -v -r ${1} $USB_MOUNT/backup/${2} $USB_MOUNT/backup/${2}.keys $BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_SCRIPT_NAME