|
@@ -237,6 +237,29 @@ function backup_local_syncthing {
|
237
|
237
|
|
238
|
238
|
echo $"Backup to syncthing complete"
|
239
|
239
|
fi
|
|
240
|
+
|
|
241
|
+ for d in /home/*/ ; do
|
|
242
|
+ USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
|
243
|
+ if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
|
244
|
+ if [ -d /home/$USERNAME/Sync ]; then
|
|
245
|
+ echo $"Backing up syncthing files for $USERNAME"
|
|
246
|
+ backup_directory_to_usb /home/$USERNAME/Sync syncthing/$USERNAME
|
|
247
|
+ # ensure that device IDs will be backed up as part of user config settings
|
|
248
|
+ if [ ! -d /home/$USERNAME/.config/syncthing ]; then
|
|
249
|
+ mkdir -p /home/$USERNAME/.config/syncthing
|
|
250
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
|
251
|
+ fi
|
|
252
|
+ if [ -f /home/$USERNAME/.syncthing-server-id ]; then
|
|
253
|
+ cp /home/$USERNAME/.syncthing-server-id /home/$USERNAME/.config/syncthing
|
|
254
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
|
255
|
+ fi
|
|
256
|
+ if [ -f /home/$USERNAME/.syncthingids ]; then
|
|
257
|
+ cp /home/$USERNAME/.syncthingids /home/$USERNAME/.config/syncthing
|
|
258
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
|
259
|
+ fi
|
|
260
|
+ fi
|
|
261
|
+ fi
|
|
262
|
+ done
|
240
|
263
|
}
|
241
|
264
|
|
242
|
265
|
function restore_local_syncthing {
|
|
@@ -327,6 +350,29 @@ function backup_remote_syncthing {
|
327
|
350
|
backup_directory_to_friend /var/lib/syncthing/SyncShared syncthingshared
|
328
|
351
|
echo $"Backup of syncthing shared files complete"
|
329
|
352
|
fi
|
|
353
|
+
|
|
354
|
+ for d in /home/*/ ; do
|
|
355
|
+ USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
|
356
|
+ if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
|
357
|
+ if [ -d /home/$USERNAME/Sync ]; then
|
|
358
|
+ echo $"Backing up syncthing files for $USERNAME"
|
|
359
|
+ backup_directory_to_friend /home/$USERNAME/Sync syncthing/$USERNAME
|
|
360
|
+ # ensure that device IDs will be backed up as part of user config settings
|
|
361
|
+ if [ ! -d /home/$USERNAME/.config/syncthing ]; then
|
|
362
|
+ mkdir -p /home/$USERNAME/.config/syncthing
|
|
363
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
|
364
|
+ fi
|
|
365
|
+ if [ -f /home/$USERNAME/.syncthing-server-id ]; then
|
|
366
|
+ cp /home/$USERNAME/.syncthing-server-id /home/$USERNAME/.config/syncthing
|
|
367
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
|
368
|
+ fi
|
|
369
|
+ if [ -f /home/$USERNAME/.syncthingids ]; then
|
|
370
|
+ cp /home/$USERNAME/.syncthingids /home/$USERNAME/.config/syncthing
|
|
371
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
|
372
|
+ fi
|
|
373
|
+ fi
|
|
374
|
+ fi
|
|
375
|
+ done
|
330
|
376
|
}
|
331
|
377
|
|
332
|
378
|
function restore_remote_syncthing {
|