This commit is contained in:
Bob Mottram 2016-01-09 18:33:44 +00:00
parent 7ff57a6f76
commit ba8f72ad91
1 changed files with 49 additions and 42 deletions

View File

@ -8318,6 +8318,8 @@ quit" > $INSTALL_DIR/batch.sql
# Ensure that the database gets backed up locally, if remote # Ensure that the database gets backed up locally, if remote
# backups are not being used # backups are not being used
backup_databases_script_header backup_databases_script_header
if ! grep -q "GNU Social" /usr/bin/backupdatabases; then
echo '' >> /usr/bin/backupdatabases echo '' >> /usr/bin/backupdatabases
echo $'# Backup the GNU Social database' >> /usr/bin/backupdatabases echo $'# Backup the GNU Social database' >> /usr/bin/backupdatabases
echo 'TEMPFILE=/root/gnusocial.sql' >> /usr/bin/backupdatabases echo 'TEMPFILE=/root/gnusocial.sql' >> /usr/bin/backupdatabases
@ -8344,7 +8346,9 @@ quit" > $INSTALL_DIR/batch.sql
echo ' # Make the backup readable only by root' >> /usr/bin/backupdatabases echo ' # Make the backup readable only by root' >> /usr/bin/backupdatabases
echo ' chmod 600 $DAILYFILE' >> /usr/bin/backupdatabases echo ' chmod 600 $DAILYFILE' >> /usr/bin/backupdatabases
echo 'fi' >> /usr/bin/backupdatabases echo 'fi' >> /usr/bin/backupdatabases
fi
if ! grep -q "GNU Social" /etc/cron.weekly/backupdatabasesweekly; then
echo '' >> /etc/cron.weekly/backupdatabasesweekly echo '' >> /etc/cron.weekly/backupdatabasesweekly
echo $'# GNU Social' >> /etc/cron.weekly/backupdatabasesweekly echo $'# GNU Social' >> /etc/cron.weekly/backupdatabasesweekly
echo 'if [ -f /var/backups/gnusocial_weekly.sql ]; then' >> /etc/cron.weekly/backupdatabasesweekly echo 'if [ -f /var/backups/gnusocial_weekly.sql ]; then' >> /etc/cron.weekly/backupdatabasesweekly
@ -8353,7 +8357,9 @@ quit" > $INSTALL_DIR/batch.sql
echo 'if [ -f /var/backups/gnusocial_daily.sql ]; then' >> /etc/cron.weekly/backupdatabasesweekly echo 'if [ -f /var/backups/gnusocial_daily.sql ]; then' >> /etc/cron.weekly/backupdatabasesweekly
echo ' cp -f /var/backups/gnusocial_daily.sql /var/backups/gnusocial_weekly.sql' >> /etc/cron.weekly/backupdatabasesweekly echo ' cp -f /var/backups/gnusocial_daily.sql /var/backups/gnusocial_weekly.sql' >> /etc/cron.weekly/backupdatabasesweekly
echo 'fi' >> /etc/cron.weekly/backupdatabasesweekly echo 'fi' >> /etc/cron.weekly/backupdatabasesweekly
fi
if ! grep -q "GNU Social" /etc/cron.monthly/backupdatabasesmonthly; then
echo '' >> /etc/cron.monthly/backupdatabasesmonthly echo '' >> /etc/cron.monthly/backupdatabasesmonthly
echo $'# GNU Social' >> /etc/cron.monthly/backupdatabasesmonthly echo $'# GNU Social' >> /etc/cron.monthly/backupdatabasesmonthly
echo 'if [ -f /var/backups/gnusocial_monthly.sql ]; then' >> /etc/cron.monthly/backupdatabasesmonthly echo 'if [ -f /var/backups/gnusocial_monthly.sql ]; then' >> /etc/cron.monthly/backupdatabasesmonthly
@ -8362,6 +8368,7 @@ quit" > $INSTALL_DIR/batch.sql
echo 'if [ -f /var/backups/gnusocial_weekly.sql ]; then' >> /etc/cron.monthly/backupdatabasesmonthly echo 'if [ -f /var/backups/gnusocial_weekly.sql ]; then' >> /etc/cron.monthly/backupdatabasesmonthly
echo ' cp -f /var/backups/gnusocial_weekly.sql /var/backups/gnusocial_monthly.sql' >> /etc/cron.monthly/backupdatabasesmonthly echo ' cp -f /var/backups/gnusocial_weekly.sql /var/backups/gnusocial_monthly.sql' >> /etc/cron.monthly/backupdatabasesmonthly
echo 'fi' >> /etc/cron.monthly/backupdatabasesmonthly echo 'fi' >> /etc/cron.monthly/backupdatabasesmonthly
fi
if ! grep -q "gnusocial" /etc/cron.hourly/repair; then if ! grep -q "gnusocial" /etc/cron.hourly/repair; then
echo "${PROJECT_NAME}-repair-database gnusocial" >> /etc/cron.hourly/repair echo "${PROJECT_NAME}-repair-database gnusocial" >> /etc/cron.hourly/repair