From 2939cfa1f6d731435de0150c09e91ee202f61e0c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 2 Nov 2016 17:49:21 +0000 Subject: [PATCH] Remove local database backups --- src/freedombone-app-gnusocial | 1 + src/freedombone-app-gogs | 1 + src/freedombone-app-postactiv | 1 + src/freedombone-app-rss | 1 + src/freedombone-utils-database | 9 +++++++++ 5 files changed, 13 insertions(+) diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index 01dcdd90..af3c5ab7 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -490,6 +490,7 @@ function remove_gnusocial { rm /etc/cron.hourly/gnusocial-daemons fi sed -i '/Gnusocial/d' /home/$MY_USERNAME/README + remove_backup_database_local gnusocial } function install_gnusocial_main { diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs index 72a7a073..3e05306d 100755 --- a/src/freedombone-app-gogs +++ b/src/freedombone-app-gogs @@ -351,6 +351,7 @@ function remove_gogs { remove_onion_service gogs ${GIT_ONION_PORT} 9418 remove_completion_param "install_gogs" sed -i '/gogs /d' $COMPLETION_FILE + remove_backup_database_local gogs } function install_gogs { diff --git a/src/freedombone-app-postactiv b/src/freedombone-app-postactiv index f75aaa63..77d297c3 100755 --- a/src/freedombone-app-postactiv +++ b/src/freedombone-app-postactiv @@ -334,6 +334,7 @@ function remove_postactiv { rm /etc/cron.hourly/postactiv-daemons fi sed -i '/Postactiv/d' /home/$MY_USERNAME/README + remove_backup_database_local postactiv } function install_postactiv_main { diff --git a/src/freedombone-app-rss b/src/freedombone-app-rss index 13243aba..dd0ccd25 100755 --- a/src/freedombone-app-rss +++ b/src/freedombone-app-rss @@ -268,6 +268,7 @@ function remove_rss { sed -i '/RSS /d' $COMPLETION_FILE sed -i '/rss /d' $COMPLETION_FILE sed -i '/RSS reader/d' /home/$MY_USERNAME/README + remove_backup_database_local ttrss } function rss_modifications { diff --git a/src/freedombone-utils-database b/src/freedombone-utils-database index c4688319..13a7e3fd 100755 --- a/src/freedombone-utils-database +++ b/src/freedombone-utils-database @@ -38,6 +38,15 @@ BACKUP_INCLUDES_DATABASES="no" # is used for backups and repair DATABASE_PASSWORD_FILE=/root/dbpass +function remove_backup_database_local { + database_name=$1 + + sed -i "/# Backup the ${database_name} database/,/# End of ${database_name} database backup/d" /usr/bin/backupdatabases + sed -i "/# Backup ${database_name}/,/# End of backup for ${database_name}/d" /etc/cron.weekly/backupdatabasesweekly + sed -i "/# Backup ${database_name}/,/# End of backup for ${database_name}/d" /etc/cron.monthly/backupdatabasesmonthly + sed -i "/${database_name}/d" /etc/cron.hourly/repair +} + function backup_database_local { # Makes local backups of databases which can then be automatically rolled # back if corruption is detected