Allow some additional user specified directories to be backed up
This commit is contained in:
parent
b49b51d265
commit
7fb07fc11d
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
PROJECT_NAME='freedombone'
|
PROJECT_NAME='freedombone'
|
||||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||||
|
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||||
|
|
||||||
export TEXTDOMAIN=${PROJECT_NAME}-backup-local
|
export TEXTDOMAIN=${PROJECT_NAME}-backup-local
|
||||||
export TEXTDOMAINDIR="/usr/share/locale"
|
export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
@ -413,6 +414,24 @@ function backup_mariadb {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function backup_extra_directories {
|
||||||
|
if [ ! -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $"Backing up some additional directories"
|
||||||
|
while read backup_line
|
||||||
|
do
|
||||||
|
backup_dir=$(echo "$backup_line" | awk -F ',' '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
if [ -d "$backup_dir" ]; then
|
||||||
|
destination_dir=$(echo "$backup_line" | awk -F ',' '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
backup_directory_to_usb "$backup_dir" "$destination_dir"
|
||||||
|
else
|
||||||
|
echo $"WARNING: Directory $backup_dir does not exist"
|
||||||
|
fi
|
||||||
|
done <$BACKUP_EXTRA_DIRECTORIES
|
||||||
|
}
|
||||||
|
|
||||||
# has the remove option been set ?
|
# has the remove option been set ?
|
||||||
remove_option=$2
|
remove_option=$2
|
||||||
if [[ $1 == "remove" ]]; then
|
if [[ $1 == "remove" ]]; then
|
||||||
|
@ -431,6 +450,7 @@ backup_configuration
|
||||||
backup_admin_readme
|
backup_admin_readme
|
||||||
backup_voip
|
backup_voip
|
||||||
backup_mariadb
|
backup_mariadb
|
||||||
|
backup_extra_directories
|
||||||
unmount_drive
|
unmount_drive
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
PROJECT_NAME='freedombone'
|
PROJECT_NAME='freedombone'
|
||||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||||
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg
|
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||||
|
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||||
|
|
||||||
export TEXTDOMAIN=${PROJECT_NAME}-backup-remote
|
export TEXTDOMAIN=${PROJECT_NAME}-backup-remote
|
||||||
export TEXTDOMAINDIR="/usr/share/locale"
|
export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
@ -438,6 +439,24 @@ function disperse_key_shares {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function backup_extra_directories {
|
||||||
|
if [ ! -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $"Backing up some additional directories"
|
||||||
|
while read backup_line
|
||||||
|
do
|
||||||
|
backup_dir=$(echo "$backup_line" | awk -F ',' '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
if [ -d "$backup_dir" ]; then
|
||||||
|
destination_dir=$(echo "$backup_line" | awk -F ',' '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
backup_directory_to_friend "$backup_dir" "$destination_dir"
|
||||||
|
else
|
||||||
|
echo $"WARNING: Directory $backup_dir does not exist"
|
||||||
|
fi
|
||||||
|
done <$BACKUP_EXTRA_DIRECTORIES
|
||||||
|
}
|
||||||
|
|
||||||
backup_configuration
|
backup_configuration
|
||||||
backup_users
|
backup_users
|
||||||
backup_letsencrypt
|
backup_letsencrypt
|
||||||
|
@ -457,6 +476,7 @@ backup_dlna
|
||||||
backup_voip
|
backup_voip
|
||||||
backup_tox
|
backup_tox
|
||||||
backup_mariadb
|
backup_mariadb
|
||||||
|
backup_extra_directories
|
||||||
|
|
||||||
# For each remote server
|
# For each remote server
|
||||||
while read remote_server
|
while read remote_server
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
PROJECT_NAME='freedombone'
|
PROJECT_NAME='freedombone'
|
||||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||||
|
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||||
|
|
||||||
export TEXTDOMAIN=${PROJECT_NAME}-restore-local
|
export TEXTDOMAIN=${PROJECT_NAME}-restore-local
|
||||||
export TEXTDOMAINDIR="/usr/share/locale"
|
export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
PROJECT_NAME='freedombone'
|
PROJECT_NAME='freedombone'
|
||||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||||
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg
|
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||||
|
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||||
|
|
||||||
export TEXTDOMAIN=${PROJECT_NAME}-restore-remote
|
export TEXTDOMAIN=${PROJECT_NAME}-restore-remote
|
||||||
export TEXTDOMAINDIR="/usr/share/locale"
|
export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
|
Loading…
Reference in New Issue