diff --git a/postgresql/defaults/main.yml b/postgresql/defaults/main.yml index df45cff3..496de592 100644 --- a/postgresql/defaults/main.yml +++ b/postgresql/defaults/main.yml @@ -181,7 +181,7 @@ postgres_gis_pkgs: pg_backup_enabled: True pg_backup_bin: /usr/local/sbin/postgresql-backup pg_backup_pgdump_bin: /usr/bin/pg_dump -pg_backup_retain_copies: 15 +pg_backup_retain_copies: 1 pg_backup_build_db_list: "no" # Dynamically created from psql_db_data if pg_backup_db_list is not set #pg_backup_db_list: '{{ psql_db_name}}' diff --git a/postgresql/files/postgresql-backup.cron b/postgresql/files/postgresql-backup.cron index c4a792c2..91fa4c82 100755 --- a/postgresql/files/postgresql-backup.cron +++ b/postgresql/files/postgresql-backup.cron @@ -22,7 +22,7 @@ if [ -f /var/log/backuppc.log ] ; then TMSTMP=$( date +%s ) . /var/log/backuppc.log 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 exit 0 fi