Browse Source

Remove local database backups

Bob Mottram 8 years ago
parent
commit
2939cfa1f6

+ 1
- 0
src/freedombone-app-gnusocial View File

@@ -490,6 +490,7 @@ function remove_gnusocial {
490 490
         rm /etc/cron.hourly/gnusocial-daemons
491 491
     fi
492 492
     sed -i '/Gnusocial/d' /home/$MY_USERNAME/README
493
+    remove_backup_database_local gnusocial
493 494
 }
494 495
 
495 496
 function install_gnusocial_main {

+ 1
- 0
src/freedombone-app-gogs View File

@@ -351,6 +351,7 @@ function remove_gogs {
351 351
     remove_onion_service gogs ${GIT_ONION_PORT} 9418
352 352
     remove_completion_param "install_gogs"
353 353
     sed -i '/gogs /d' $COMPLETION_FILE
354
+    remove_backup_database_local gogs
354 355
 }
355 356
 
356 357
 function install_gogs {

+ 1
- 0
src/freedombone-app-postactiv View File

@@ -334,6 +334,7 @@ function remove_postactiv {
334 334
         rm /etc/cron.hourly/postactiv-daemons
335 335
     fi
336 336
     sed -i '/Postactiv/d' /home/$MY_USERNAME/README
337
+    remove_backup_database_local postactiv
337 338
 }
338 339
 
339 340
 function install_postactiv_main {

+ 1
- 0
src/freedombone-app-rss View File

@@ -268,6 +268,7 @@ function remove_rss {
268 268
     sed -i '/RSS /d' $COMPLETION_FILE
269 269
     sed -i '/rss /d' $COMPLETION_FILE
270 270
     sed -i '/RSS reader/d' /home/$MY_USERNAME/README
271
+    remove_backup_database_local ttrss
271 272
 }
272 273
 
273 274
 function rss_modifications {

+ 9
- 0
src/freedombone-utils-database View File

@@ -38,6 +38,15 @@ BACKUP_INCLUDES_DATABASES="no"
38 38
 # is used for backups and repair
39 39
 DATABASE_PASSWORD_FILE=/root/dbpass
40 40
 
41
+function remove_backup_database_local {
42
+    database_name=$1
43
+
44
+    sed -i "/# Backup the ${database_name} database/,/# End of ${database_name} database backup/d" /usr/bin/backupdatabases
45
+    sed -i "/# Backup ${database_name}/,/# End of backup for ${database_name}/d" /etc/cron.weekly/backupdatabasesweekly
46
+    sed -i "/# Backup ${database_name}/,/# End of backup for ${database_name}/d" /etc/cron.monthly/backupdatabasesmonthly
47
+    sed -i "/${database_name}/d" /etc/cron.hourly/repair
48
+}
49
+
41 50
 function backup_database_local {
42 51
     # Makes local backups of databases which can then be automatically rolled
43 52
     # back if corruption is detected