|
|
|
|
251
|
}
|
251
|
}
|
252
|
|
252
|
|
253
|
function backup_local_syncthing {
|
253
|
function backup_local_syncthing {
|
254
|
- if [ -d /var/lib/syncthing/SyncShared ]; then
|
|
|
|
|
254
|
+ if [ -d $SYNCTHING_SHARED_DATA ]; then
|
255
|
function_check backup_directory_to_usb
|
255
|
function_check backup_directory_to_usb
|
256
|
- backup_directory_to_usb /var/lib/syncthing/SyncShared syncthingshared
|
|
|
|
|
256
|
+ backup_directory_to_usb $SYNCTHING_SHARED_DATA syncthingshared
|
257
|
backup_directory_to_usb /root/.config/syncthing syncthingconfig
|
257
|
backup_directory_to_usb /root/.config/syncthing syncthingconfig
|
258
|
fi
|
258
|
fi
|
259
|
|
259
|
|
|
|
|
|
314
|
restore_directory_from_usb ${temp_restore_dir}shared syncthingshared
|
314
|
restore_directory_from_usb ${temp_restore_dir}shared syncthingshared
|
315
|
#cp -r ${temp_restore_dir}shared/* /
|
315
|
#cp -r ${temp_restore_dir}shared/* /
|
316
|
|
316
|
|
317
|
- if [ ! -d /var/lib/syncthing/SyncShared ]; then
|
|
|
318
|
- mkdir -p /var/lib/syncthing/SyncShared
|
|
|
|
|
317
|
+ if [ ! -d $SYNCTHING_SHARED_DATA ]; then
|
|
|
318
|
+ mkdir -p $SYNCTHING_SHARED_DATA
|
319
|
fi
|
319
|
fi
|
320
|
- cp -r ${temp_restore_dir}shared/* /var/lib/syncthing/SyncShared/
|
|
|
|
|
320
|
+ cp -r ${temp_restore_dir}shared/* $SYNCTHING_SHARED_DATA/
|
321
|
|
321
|
|
322
|
if [ ! "$?" = "0" ]; then
|
322
|
if [ ! "$?" = "0" ]; then
|
323
|
set_user_permissions
|
323
|
set_user_permissions
|
|
|
|
|
379
|
backup_directory_to_friend /root/.config/syncthing syncthingconfig
|
379
|
backup_directory_to_friend /root/.config/syncthing syncthingconfig
|
380
|
echo $"Backup of syncthing configuration complete"
|
380
|
echo $"Backup of syncthing configuration complete"
|
381
|
fi
|
381
|
fi
|
382
|
- if [ -d /var/lib/syncthing/SyncShared ]; then
|
|
|
|
|
382
|
+ if [ -d $SYNCTHING_SHARED_DATA ]; then
|
383
|
echo $"Backing up syncthing shared files"
|
383
|
echo $"Backing up syncthing shared files"
|
384
|
function_check backup_directory_to_friend
|
384
|
function_check backup_directory_to_friend
|
385
|
- backup_directory_to_friend /var/lib/syncthing/SyncShared syncthingshared
|
|
|
|
|
385
|
+ backup_directory_to_friend $SYNCTHING_SHARED_DATA syncthingshared
|
386
|
echo $"Backup of syncthing shared files complete"
|
386
|
echo $"Backup of syncthing shared files complete"
|
387
|
fi
|
387
|
fi
|
388
|
|
388
|
|
|
|
|
|
440
|
function_check restore_directory_from_friend
|
440
|
function_check restore_directory_from_friend
|
441
|
restore_directory_from_friend $temp_restore_dir syncthingshared
|
441
|
restore_directory_from_friend $temp_restore_dir syncthingshared
|
442
|
#cp -r $temp_restore_dir/* /
|
442
|
#cp -r $temp_restore_dir/* /
|
443
|
- if [ ! -d /var/lib/syncthing/SyncShared ]; then
|
|
|
444
|
- mkdir -p /var/lib/syncthing/SyncShared
|
|
|
|
|
443
|
+ if [ ! -d $SYNCTHING_SHARED_DATA ]; then
|
|
|
444
|
+ mkdir -p $SYNCTHING_SHARED_DATA
|
445
|
fi
|
445
|
fi
|
446
|
- cp -r ${temp_restore_dir}shared/* /var/lib/syncthing/SyncShared/
|
|
|
|
|
446
|
+ cp -r ${temp_restore_dir}shared/* $SYNCTHING_SHARED_DATA/
|
447
|
if [ ! "$?" = "0" ]; then
|
447
|
if [ ! "$?" = "0" ]; then
|
448
|
systemctl start syncthing
|
448
|
systemctl start syncthing
|
449
|
systemctl start cron
|
449
|
systemctl start cron
|