Kaynağa Gözat

Consolidate backup_apps

Bob Mottram 8 yıl önce
ebeveyn
işleme
b62ffd74b6

+ 1
- 21
src/freedombone-backup-local Dosyayı Görüntüle

249
 	done
249
 	done
250
 }
250
 }
251
 
251
 
252
-function backup_apps {
253
-	FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
254
-
255
-	APPS_COMPLETED=()
256
-
257
-	# for all the app scripts
258
-	for filename in $FILES
259
-	do
260
-		app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
261
-		if [[ $(item_in_array ${app_name} ${APPS_COMPLETED[@]}) != 0 ]]; then
262
-			function_check app_is_installed
263
-			if [[ "$(app_is_installed $a)" == "1" ]]; then
264
-				APPS_COMPLETED+=("${app_name}")
265
-				function_check backup_local_${app_name}
266
-				backup_local_${app_name}
267
-			fi
268
-		fi
269
-	done
270
-}
271
-
272
 function remove_backup_directory {
252
 function remove_backup_directory {
273
 	if [ $1 ]; then
253
 	if [ $1 ]; then
274
 		if [[ $1 == "remove" ]]; then
254
 		if [[ $1 == "remove" ]]; then
420
 backup_users
400
 backup_users
421
 prepare_directories
401
 prepare_directories
422
 backup_directories
402
 backup_directories
423
-backup_apps
403
+backup_apps local
424
 backup_configuration
404
 backup_configuration
425
 backup_admin_readme
405
 backup_admin_readme
426
 backup_mariadb
406
 backup_mariadb

+ 1
- 2
src/freedombone-backup-remote Dosyayı Görüntüle

424
 	backup_mariadb
424
 	backup_mariadb
425
 	backup_certs
425
 	backup_certs
426
 	backup_mailing_list
426
 	backup_mailing_list
427
-
428
-
427
+	backup_apps remote
429
 	backup_extra_directories
428
 	backup_extra_directories
430
 fi
429
 fi
431
 
430
 

+ 19
- 0
src/freedombone-utils-backup Dosyayı Görüntüle

363
 	backup_directory_to_friend /root/temp${database_name}data ${database_name}data
363
 	backup_directory_to_friend /root/temp${database_name}data ${database_name}data
364
 }
364
 }
365
 
365
 
366
+function backup_apps {
367
+	localremote=$1
368
+	FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
369
+
370
+	BACKUP_APPS_COMPLETED=()
371
+
372
+	# for all the app scripts
373
+	for filename in $FILES
374
+	do
375
+		app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
376
+		if [[ $(item_in_array ${app_name} ${BACKUP_APPS_COMPLETED[@]}) != 0 ]]; then
377
+			if [[ "$(app_is_installed $a)" == "1" ]]; then
378
+				BACKUP_APPS_COMPLETED+=("${app_name}")
379
+				backup_${localremote}_${app_name}
380
+			fi
381
+		fi
382
+	done
383
+}
384
+
366
 # NOTE: deliberately no exit 0
385
 # NOTE: deliberately no exit 0