library/roles/postgresql: Fix a broken check in postgresql-backup.cron. Now if backuppc is running, the cron job does nothing.

This commit is contained in:
Andrea Dell'Amico 2016-11-28 17:58:23 +01:00
parent cffd1ce098
commit 5f73bac089
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ postgres_gis_pkgs:
pg_backup_enabled: True pg_backup_enabled: True
pg_backup_bin: /usr/local/sbin/postgresql-backup pg_backup_bin: /usr/local/sbin/postgresql-backup
pg_backup_pgdump_bin: /usr/bin/pg_dump pg_backup_pgdump_bin: /usr/bin/pg_dump
pg_backup_retain_copies: 15 pg_backup_retain_copies: 1
pg_backup_build_db_list: "no" pg_backup_build_db_list: "no"
# Dynamically created from psql_db_data if pg_backup_db_list is not set # Dynamically created from psql_db_data if pg_backup_db_list is not set
#pg_backup_db_list: '{{ psql_db_name}}' #pg_backup_db_list: '{{ psql_db_name}}'

View File

@ -22,7 +22,7 @@ if [ -f /var/log/backuppc.log ] ; then
TMSTMP=$( date +%s ) TMSTMP=$( date +%s )
. /var/log/backuppc.log . /var/log/backuppc.log
LAST_BACKUP_TIME=$( expr $TMSTMP - $BACKUP_TIMESTAMP ) LAST_BACKUP_TIME=$( expr $TMSTMP - $BACKUP_TIMESTAMP )
if [ $LAST_BACKUP_TIME -gt 86400 -a $BACKUP_RESULT == 'OK' ] ; then if [ $LAST_BACKUP_TIME -lt 86400 -a $BACKUP_RESULT == 'OK' ] ; then
echo "BackupPC is active, doing nothing" > $LOG_FILE echo "BackupPC is active, doing nothing" > $LOG_FILE
exit 0 exit 0
fi fi