This commit is contained in:
Bob Mottram 2017-09-03 11:20:52 +01:00
parent 249d56eb24
commit 387ae1d2cd
1 changed files with 10 additions and 10 deletions

View File

@ -251,9 +251,9 @@ function upgrade_syncthing {
}
function backup_local_syncthing {
if [ -d /var/lib/syncthing/SyncShared ]; then
if [ -d $SYNCTHING_SHARED_DATA ]; then
function_check backup_directory_to_usb
backup_directory_to_usb /var/lib/syncthing/SyncShared syncthingshared
backup_directory_to_usb $SYNCTHING_SHARED_DATA syncthingshared
backup_directory_to_usb /root/.config/syncthing syncthingconfig
fi
@ -314,10 +314,10 @@ function restore_local_syncthing {
restore_directory_from_usb ${temp_restore_dir}shared syncthingshared
#cp -r ${temp_restore_dir}shared/* /
if [ ! -d /var/lib/syncthing/SyncShared ]; then
mkdir -p /var/lib/syncthing/SyncShared
if [ ! -d $SYNCTHING_SHARED_DATA ]; then
mkdir -p $SYNCTHING_SHARED_DATA
fi
cp -r ${temp_restore_dir}shared/* /var/lib/syncthing/SyncShared/
cp -r ${temp_restore_dir}shared/* $SYNCTHING_SHARED_DATA/
if [ ! "$?" = "0" ]; then
set_user_permissions
@ -379,10 +379,10 @@ function backup_remote_syncthing {
backup_directory_to_friend /root/.config/syncthing syncthingconfig
echo $"Backup of syncthing configuration complete"
fi
if [ -d /var/lib/syncthing/SyncShared ]; then
if [ -d $SYNCTHING_SHARED_DATA ]; then
echo $"Backing up syncthing shared files"
function_check backup_directory_to_friend
backup_directory_to_friend /var/lib/syncthing/SyncShared syncthingshared
backup_directory_to_friend $SYNCTHING_SHARED_DATA syncthingshared
echo $"Backup of syncthing shared files complete"
fi
@ -440,10 +440,10 @@ function restore_remote_syncthing {
function_check restore_directory_from_friend
restore_directory_from_friend $temp_restore_dir syncthingshared
#cp -r $temp_restore_dir/* /
if [ ! -d /var/lib/syncthing/SyncShared ]; then
mkdir -p /var/lib/syncthing/SyncShared
if [ ! -d $SYNCTHING_SHARED_DATA ]; then
mkdir -p $SYNCTHING_SHARED_DATA
fi
cp -r ${temp_restore_dir}shared/* /var/lib/syncthing/SyncShared/
cp -r ${temp_restore_dir}shared/* $SYNCTHING_SHARED_DATA/
if [ ! "$?" = "0" ]; then
systemctl start syncthing
systemctl start cron