This commit is contained in:
Bob Mottram 2017-09-03 11:22:41 +01:00
parent 387ae1d2cd
commit 8adf27e743
1 changed files with 9 additions and 9 deletions

View File

@ -254,7 +254,7 @@ function backup_local_syncthing {
if [ -d $SYNCTHING_SHARED_DATA ]; then
function_check backup_directory_to_usb
backup_directory_to_usb $SYNCTHING_SHARED_DATA syncthingshared
backup_directory_to_usb /root/.config/syncthing syncthingconfig
backup_directory_to_usb $SYNCTHING_CONFIG_PATH syncthingconfig
fi
for d in /home/*/ ; do
@ -294,10 +294,10 @@ function restore_local_syncthing {
restore_directory_from_usb ${temp_restore_dir}config syncthingconfig
#cp -r ${temp_restore_dir}config/* /
if [ ! -d /root/.config/syncthing ]; then
mkdir -p /root/.config/syncthing
if [ ! -d $SYNCTHING_CONFIG_PATH ]; then
mkdir -p $SYNCTHING_CONFIG_PATH
fi
cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
if [ ! "$?" = "0" ]; then
set_user_permissions
@ -373,10 +373,10 @@ function restore_local_syncthing {
}
function backup_remote_syncthing {
if [ -d /root/.config/syncthing ]; then
if [ -d $SYNCTHING_CONFIG_PATH ]; then
echo $"Backing up syncthing configuration"
function_check backup_directory_to_friend
backup_directory_to_friend /root/.config/syncthing syncthingconfig
backup_directory_to_friend $SYNCTHING_CONFIG_PATH syncthingconfig
echo $"Backup of syncthing configuration complete"
fi
if [ -d $SYNCTHING_SHARED_DATA ]; then
@ -422,10 +422,10 @@ function restore_remote_syncthing {
function_check restore_directory_from_friend
restore_directory_from_friend $temp_restore_dir syncthingconfig
#cp -r $temp_restore_dir/* /
if [ ! -d /root/.config/syncthing ]; then
mkdir -p /root/.config/syncthing
if [ ! -d $SYNCTHING_CONFIG_PATH ]; then
mkdir -p $SYNCTHING_CONFIG_PATH
fi
cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
if [ ! "$?" = "0" ]; then
systemctl start syncthing
systemctl start cron