Sfoglia il codice sorgente

Move remote mediagoblin backup to app script

Bob Mottram 8 anni fa
parent
commit
eaa7baba88

+ 15
- 2
src/freedombone-app-hubzilla Vedi File

@@ -41,7 +41,7 @@ HUBZILLA_COMMIT='2d79e75788aa71664a379c4cea0b6bfe3ab87ad0'
41 41
 HUBZILLA_ADDONS_COMMIT='67b40c7a40f328a93ee030eb15e9e1261f3cba64'
42 42
 
43 43
 function reconfigure_hubzilla {
44
-    echo -n ''
44
+	echo -n ''
45 45
 }
46 46
 
47 47
 function upgrade_hubzilla {
@@ -105,7 +105,20 @@ function restore_local_hubzilla {
105 105
 }
106 106
 
107 107
 function backup_remote_hubzilla {
108
-	echo -n ''
108
+	if grep -q "Hubzilla domain" $COMPLETION_FILE; then
109
+		HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
110
+		temp_backup_dir=/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs
111
+		if [ -d $temp_backup_dir ]; then
112
+			suspend_site ${HUBZILLA_DOMAIN_NAME}
113
+			backup_database_to_friend hubzilla
114
+			echo "Backing up Hubzilla installation"
115
+			backup_directory_to_friend $temp_backup_dir hubzilla
116
+			restart_site
117
+		else
118
+			echo $"Hubzilla domain specified but not found in /var/www/${HUBZILLA_DOMAIN_NAME}"
119
+			exit 2578
120
+		fi
121
+	fi
109 122
 }
110 123
 
111 124
 function restore_remote_hubzilla {

+ 14
- 1
src/freedombone-app-mediagoblin Vedi File

@@ -54,7 +54,20 @@ function restore_local_mediagoblin {
54 54
 }
55 55
 
56 56
 function backup_remote_mediagoblin {
57
-	echo -n ''
57
+	if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
58
+		MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
59
+		function_check suspend_site
60
+		suspend_site ${MEDIAGOBLIN_DOMAIN_NAME}
61
+
62
+		echo $"Backing up Mediagoblin"
63
+
64
+		backup_directory_to_friend /var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs mediagoblin
65
+
66
+		function_check restart_site
67
+		restart_site
68
+
69
+		echo $"Backup of Mediagoblin complete"
70
+	fi
58 71
 }
59 72
 
60 73
 function restore_remote_mediagoblin {

+ 12
- 1
src/freedombone-app-syncthing Vedi File

@@ -135,7 +135,18 @@ function restore_local_syncthing {
135 135
 }
136 136
 
137 137
 function backup_remote_syncthing {
138
-	echo -n ''
138
+	if [ -d /root/.config/syncthing ]; then
139
+		echo $"Backing up syncthing configuration"
140
+		function_check backup_directory_to_friend
141
+		backup_directory_to_friend /root/.config/syncthing syncthingconfig
142
+		echo $"Backup of syncthing configuration complete"
143
+	fi
144
+	if [ -d /var/lib/syncthing/SyncShared ]; then
145
+		echo $"Backing up syncthing shared files"
146
+		function_check backup_directory_to_friend
147
+		backup_directory_to_friend /var/lib/syncthing/SyncShared syncthingshared
148
+		echo $"Backup of syncthing shared files complete"
149
+	fi
139 150
 }
140 151
 
141 152
 function restore_remote_syncthing {

+ 0
- 41
src/freedombone-backup-remote Vedi File

@@ -244,44 +244,6 @@ function backup_tor {
244 244
 	fi
245 245
 }
246 246
 
247
-function backup_hubzilla {
248
-	if grep -q "Hubzilla domain" $COMPLETION_FILE; then
249
-		HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
250
-		if [ -d /var/www/${HUBZILLA_DOMAIN_NAME} ]; then
251
-			suspend_site ${HUBZILLA_DOMAIN_NAME}
252
-			backup_database_to_friend hubzilla
253
-			backup_directory_to_friend /root/temphubzilladata hubzilladata
254
-			echo "Backing up Hubzilla installation"
255
-			backup_directory_to_friend /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs hubzilla
256
-			restart_site
257
-		else
258
-			echo $"Hubzilla domain specified but not found in /var/www/${HUBZILLA_DOMAIN_NAME}"
259
-			exit 2578
260
-		fi
261
-	fi
262
-}
263
-
264
-function backup_syncthing {
265
-	if [ -d /root/.config/syncthing ]; then
266
-		echo $"Backing up syncthing configuration"
267
-		backup_directory_to_friend /root/.config/syncthing syncthingconfig
268
-	fi
269
-	if [ -d /var/lib/syncthing/SyncShared ]; then
270
-		echo $"Backing up syncthing shared files"
271
-		backup_directory_to_friend /var/lib/syncthing/SyncShared syncthingshared
272
-	fi
273
-}
274
-
275
-function backup_mediagoblin {
276
-	if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
277
-		MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
278
-		suspend_site ${MEDIAGOBLIN_DOMAIN_NAME}
279
-		echo $"Backing up Mediagoblin"
280
-		backup_directory_to_friend /var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs mediagoblin
281
-		restart_site
282
-	fi
283
-}
284
-
285 247
 function backup_gogs {
286 248
 	export GVM_ROOT=/home/git/gvm
287 249
 	if [ -d $GVM_ROOT/bin ]; then
@@ -552,9 +514,6 @@ if [[ $TEST_MODE == "no" ]]; then
552 514
 	backup_admin_readme
553 515
 	backup_mariadb
554 516
 
555
-	backup_hubzilla
556
-	backup_syncthing
557
-	backup_mediagoblin
558 517
 	backup_gogs
559 518
 	backup_wiki
560 519
 	backup_blog