|
@@ -3330,14 +3330,14 @@ function create_restore_script {
|
3330
|
3330
|
fi
|
3331
|
3331
|
|
3332
|
3332
|
if grep -Fxq "install_owncloud" $COMPLETION_FILE; then
|
3333
|
|
- RESTORE_SUBDIR='root/'
|
3334
|
|
- if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3335
|
|
- RESTORE_SUBDIR='usb/backup/owncloud2/'
|
3336
|
|
- fi
|
3337
|
3333
|
BACKUP_INCLUDES_WEBSITES="yes"
|
3338
|
3334
|
restore_database owncloud $OWNCLOUD_DOMAIN_NAME
|
3339
|
3335
|
echo "if [ -d $USB_MOUNT/backup/owncloud2 ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3340
|
3336
|
restore_directory_from_usb '/root/tempowncloud2' 'owncloud2'
|
|
3337
|
+ RESTORE_SUBDIR='etc/'
|
|
3338
|
+ if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
|
3339
|
+ RESTORE_SUBDIR='usb/backup/owncloud2/'
|
|
3340
|
+ fi
|
3341
|
3341
|
echo " cp -r /root/tempowncloud2/${RESTORE_SUBDIR}owncloud/* /etc/owncloud/" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3342
|
3342
|
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3343
|
3343
|
echo " umount $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
@@ -3355,12 +3355,12 @@ function create_restore_script {
|
3355
|
3355
|
fi
|
3356
|
3356
|
|
3357
|
3357
|
if grep -Fxq "install_gogs" $COMPLETION_FILE; then
|
3358
|
|
- RESTORE_SUBDIR='root'
|
|
3358
|
+ BACKUP_INCLUDES_WEBSITES="yes"
|
|
3359
|
+ restore_database gogs $GIT_DOMAIN_NAME
|
|
3360
|
+ RESTORE_SUBDIR='home'
|
3359
|
3361
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3360
|
3362
|
RESTORE_SUBDIR='usb/backup/gogs'
|
3361
|
3363
|
fi
|
3362
|
|
- BACKUP_INCLUDES_WEBSITES="yes"
|
3363
|
|
- restore_database gogs $GIT_DOMAIN_NAME
|
3364
|
3364
|
echo "if [ -d $USB_MOUNT/backup/gogs ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3365
|
3365
|
echo ' echo "Restoring Gogs settings"' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3366
|
3366
|
echo ' if [ ! -d /home/git/go/src/github.com/gogits/gogs/custom ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
@@ -3405,7 +3405,7 @@ function create_restore_script {
|
3405
|
3405
|
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3406
|
3406
|
fi
|
3407
|
3407
|
|
3408
|
|
- RESTORE_SUBDIR='root'
|
|
3408
|
+ RESTORE_SUBDIR='var'
|
3409
|
3409
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3410
|
3410
|
RESTORE_SUBDIR='usb/backup/wiki'
|
3411
|
3411
|
fi
|
|
@@ -3419,6 +3419,7 @@ function create_restore_script {
|
3419
|
3419
|
echo ' exit 868' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3420
|
3420
|
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3421
|
3421
|
restore_directory_from_usb '/root/tempwiki2' 'wiki2'
|
|
3422
|
+ RESTORE_SUBDIR='etc'
|
3422
|
3423
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3423
|
3424
|
RESTORE_SUBDIR='usb/backup/wiki2'
|
3424
|
3425
|
fi
|
|
@@ -3438,7 +3439,7 @@ function create_restore_script {
|
3438
|
3439
|
echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3439
|
3440
|
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3440
|
3441
|
|
3441
|
|
- RESTORE_SUBDIR='root'
|
|
3442
|
+ RESTORE_SUBDIR='var'
|
3442
|
3443
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3443
|
3444
|
RESTORE_SUBDIR='usb/backup/blog'
|
3444
|
3445
|
fi
|
|
@@ -3467,7 +3468,7 @@ function create_restore_script {
|
3467
|
3468
|
echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3468
|
3469
|
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3469
|
3470
|
|
3470
|
|
- RESTORE_SUBDIR='root'
|
|
3471
|
+ RESTORE_SUBDIR='etc'
|
3471
|
3472
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3472
|
3473
|
RESTORE_SUBDIR='usb/backup/cjdns'
|
3473
|
3474
|
fi
|
|
@@ -3505,7 +3506,7 @@ function create_restore_script {
|
3505
|
3506
|
echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3506
|
3507
|
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3507
|
3508
|
|
3508
|
|
- RESTORE_SUBDIR='root'
|
|
3509
|
+ RESTORE_SUBDIR='var'
|
3509
|
3510
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3510
|
3511
|
RESTORE_SUBDIR='usb/backup/dlna'
|
3511
|
3512
|
fi
|
|
@@ -3524,16 +3525,22 @@ function create_restore_script {
|
3524
|
3525
|
echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3525
|
3526
|
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3526
|
3527
|
|
3527
|
|
- RESTORE_SUBDIR='root'
|
3528
|
|
- if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
3529
|
|
- RESTORE_SUBDIR='usb/backup/voip'
|
3530
|
|
- fi
|
3531
|
3528
|
echo "if [ -d $USB_MOUNT/backup/voip ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3532
|
3529
|
echo ' echo "Restoring VoIP settings"' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3533
|
3530
|
restore_directory_from_usb '/root/tempvoip' 'voip'
|
|
3531
|
+ RESTORE_SUBDIR='home'
|
|
3532
|
+ if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
|
3533
|
+ RESTORE_SUBDIR='usb/backup/voip'
|
|
3534
|
+ fi
|
3534
|
3535
|
echo -n " cp -f /root/tempvoip/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3535
|
3536
|
echo -n '$MY_USERNAME/tempbackup/' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3536
|
3537
|
echo "$VOIP_CONFIG_FILE /etc/" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
3538
|
+ echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
3539
|
+ echo " umount $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
3540
|
+ echo " rm -rf $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
3541
|
+ echo ' rm -rf /root/tempvoip' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
3542
|
+ echo ' exit 3679' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
3543
|
+ echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3537
|
3544
|
echo -n " cp -f /root/tempvoip/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3538
|
3545
|
echo -n '$MY_USERNAME/tempbackup/' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
3539
|
3546
|
echo "$VOIP_DATABASE /var/lib/mumble-server/" >> /usr/bin/$RESTORE_SCRIPT_NAME
|
|
@@ -4639,12 +4646,12 @@ function restore_from_friend {
|
4639
|
4646
|
fi
|
4640
|
4647
|
|
4641
|
4648
|
if grep -Fxq "install_owncloud" $COMPLETION_FILE; then
|
4642
|
|
- RESTORE_SUBDIR='root'
|
|
4649
|
+ BACKUP_INCLUDES_WEBSITES="yes"
|
|
4650
|
+ restore_database_from_friend owncloud $OWNCLOUD_DOMAIN_NAME
|
|
4651
|
+ RESTORE_SUBDIR='var'
|
4643
|
4652
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4644
|
4653
|
RESTORE_SUBDIR='remoterestore/backup/owncloud'
|
4645
|
4654
|
fi
|
4646
|
|
- BACKUP_INCLUDES_WEBSITES="yes"
|
4647
|
|
- restore_database_from_friend owncloud $OWNCLOUD_DOMAIN_NAME
|
4648
|
4655
|
echo 'if [ -d $SERVER_DIRECTORY/backup/owncloud ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4649
|
4656
|
echo ' echo "Restoring Owncloud installation"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4650
|
4657
|
echo " cp -r /root/tempowncloud/${RESTORE_SUBDIR}/lib/owncloud/* /var/lib/owncloud/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
@@ -4652,6 +4659,7 @@ function restore_from_friend {
|
4652
|
4659
|
echo ' exit 981' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4653
|
4660
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4654
|
4661
|
restore_directory_from_friend /root/tempowncloud2 owncloud2
|
|
4662
|
+ RESTORE_SUBDIR='etc'
|
4655
|
4663
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4656
|
4664
|
RESTORE_SUBDIR='remoterestore/backup/owncloud2'
|
4657
|
4665
|
fi
|
|
@@ -4670,12 +4678,12 @@ function restore_from_friend {
|
4670
|
4678
|
fi
|
4671
|
4679
|
|
4672
|
4680
|
if grep -Fxq "install_gogs" $COMPLETION_FILE; then
|
4673
|
|
- RESTORE_SUBDIR='root'
|
|
4681
|
+ BACKUP_INCLUDES_WEBSITES="yes"
|
|
4682
|
+ restore_database_from_friend gogs $GIT_DOMAIN_NAME
|
|
4683
|
+ RESTORE_SUBDIR='home'
|
4674
|
4684
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4675
|
4685
|
RESTORE_SUBDIR='remoterestore/backup/gogs'
|
4676
|
4686
|
fi
|
4677
|
|
- BACKUP_INCLUDES_WEBSITES="yes"
|
4678
|
|
- restore_database_from_friend gogs $GIT_DOMAIN_NAME
|
4679
|
4687
|
echo 'if [ -d $SERVER_DIRECTORY/backup/gogs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4680
|
4688
|
echo ' if [ ! -d /home/git/go/src/github.com/gogits/gogs/custom ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4681
|
4689
|
echo ' mkdir -p /home/git/go/src/github.com/gogits/gogs/custom' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
@@ -4686,6 +4694,7 @@ function restore_from_friend {
|
4686
|
4694
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4687
|
4695
|
echo ' echo "Restoring Gogs repos"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4688
|
4696
|
restore_directory_from_friend /root/tempgogsrepos gogsrepos
|
|
4697
|
+ RESTORE_SUBDIR='home'
|
4689
|
4698
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4690
|
4699
|
RESTORE_SUBDIR='remoterestore/backup/gogsrepos'
|
4691
|
4700
|
fi
|
|
@@ -4698,6 +4707,7 @@ function restore_from_friend {
|
4698
|
4707
|
echo ' if [ ! -d /home/git/.ssh ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4699
|
4708
|
echo ' mkdir /home/git/.ssh' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4700
|
4709
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
4710
|
+ RESTORE_SUBDIR='home'
|
4701
|
4711
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4702
|
4712
|
RESTORE_SUBDIR='remoterestore/backup/gogsssh'
|
4703
|
4713
|
fi
|
|
@@ -4713,7 +4723,7 @@ function restore_from_friend {
|
4713
|
4723
|
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4714
|
4724
|
fi
|
4715
|
4725
|
|
4716
|
|
- RESTORE_SUBDIR='root'
|
|
4726
|
+ RESTORE_SUBDIR='var'
|
4717
|
4727
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4718
|
4728
|
RESTORE_SUBDIR='remoterestore/backup/wiki'
|
4719
|
4729
|
fi
|
|
@@ -4725,6 +4735,7 @@ function restore_from_friend {
|
4725
|
4735
|
echo ' exit 868' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4726
|
4736
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4727
|
4737
|
restore_directory_from_friend /root/tempwiki2 wiki2
|
|
4738
|
+ RESTORE_SUBDIR='etc'
|
4728
|
4739
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4729
|
4740
|
RESTORE_SUBDIR='remoterestore/backup/wiki2'
|
4730
|
4741
|
fi
|
|
@@ -4742,7 +4753,7 @@ function restore_from_friend {
|
4742
|
4753
|
echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4743
|
4754
|
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4744
|
4755
|
|
4745
|
|
- RESTORE_SUBDIR='root'
|
|
4756
|
+ RESTORE_SUBDIR='var'
|
4746
|
4757
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4747
|
4758
|
RESTORE_SUBDIR='remoterestore/backup/blog'
|
4748
|
4759
|
fi
|
|
@@ -4767,7 +4778,7 @@ function restore_from_friend {
|
4767
|
4778
|
echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4768
|
4779
|
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4769
|
4780
|
|
4770
|
|
- RESTORE_SUBDIR='root'
|
|
4781
|
+ RESTORE_SUBDIR='etc'
|
4771
|
4782
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4772
|
4783
|
RESTORE_SUBDIR='remoterestore/backup/cjdns'
|
4773
|
4784
|
fi
|
|
@@ -4783,7 +4794,7 @@ function restore_from_friend {
|
4783
|
4794
|
echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4784
|
4795
|
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4785
|
4796
|
|
4786
|
|
- RESTORE_SUBDIR='root'
|
|
4797
|
+ RESTORE_SUBDIR='home'
|
4787
|
4798
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4788
|
4799
|
RESTORE_SUBDIR='remoterestore/backup/voip'
|
4789
|
4800
|
fi
|
|
@@ -4793,6 +4804,10 @@ function restore_from_friend {
|
4793
|
4804
|
echo -n " cp -f /root/tempvoip/${RESTORE_SUBDIR}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4794
|
4805
|
echo -n '/$MY_USERNAME/tempbackup/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4795
|
4806
|
echo "$VOIP_CONFIG_FILE /etc/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
4807
|
+ echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
4808
|
+ echo ' rm -rf /root/tempvoip' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
4809
|
+ echo ' exit 7823' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
4810
|
+ echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4796
|
4811
|
echo -n " cp -f /root/tempvoip/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4797
|
4812
|
echo -n '$MY_USERNAME/tempbackup/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4798
|
4813
|
echo "$VOIP_DATABASE /var/lib/mumble-server/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
|
@@ -4840,7 +4855,7 @@ function restore_from_friend {
|
4840
|
4855
|
echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4841
|
4856
|
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
4842
|
4857
|
|
4843
|
|
- RESTORE_SUBDIR='root'
|
|
4858
|
+ RESTORE_SUBDIR='var'
|
4844
|
4859
|
if [[ $BACKUP_TYPE != 'obnam' ]]; then
|
4845
|
4860
|
RESTORE_SUBDIR='remoterestore/backup/dlna'
|
4846
|
4861
|
fi
|