Remove local database backups

This commit is contained in:
Bob Mottram 2016-11-02 17:49:21 +00:00
parent 92edc9d62d
commit 2939cfa1f6
5 changed files with 13 additions and 0 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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