# The following example will auto-generate an incremental report from a # postgresql log file, which is rotated on a daily base, every day at 04:00. # # You need the following settings in a standard postgresql-server installation # in /var/lib/pgsql/data/postgresql.conf for this: # log_filename = 'postgresql-%Y-%m-%d.log' # log_rotation_age = 1d # log_rotation_size = 0 # # The output will be placed below /srv/www/htdocs/pgbadger/ # # See https://github.com/darold/pgbadger/ for more details # #-0 4 * * * /usr/bin/pgbadger -I -q /var/lib/pgsql/data/pg_log/postgresql-$(date "+%Y-%m-%d" -d "yesterday").log -O /srv/www/htdocs/pgbadger/ # # The following example will generate a report every week using incremental behavior # #-0 4 * * 1 /usr/bin/pgbadger -q `find /var/lib/pgsql/data/ -mtime -7 -name "postgresql.log*"` -o /srv/www/htdocs/pgbadger/reports/pg_errors-`date +\%F`.html -l /srv/www/htdocs/pgbadger/reports/pgbadger_incremental_file.dat