2023-11-16 18:45:27 +01:00
|
|
|
#
|
2023-12-07 09:21:48 +01:00
|
|
|
# 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_directory = '/var/log/pgsql'
|
2023-11-16 18:45:27 +01:00
|
|
|
# log_filename = 'postgresql-%Y-%m-%d.log'
|
2023-12-07 09:21:48 +01:00
|
|
|
# log_file_mode = 0640
|
2023-11-16 18:45:27 +01:00
|
|
|
# log_rotation_age = 1d
|
|
|
|
# log_rotation_size = 0
|
|
|
|
#
|
2023-12-07 09:21:48 +01:00
|
|
|
# Once you created a new user pgbadger, you can place the script below
|
|
|
|
# /etc/cron.d/
|
|
|
|
# Please have a look at /usr/share/doc/packages/pgbadger/README.SUSE
|
|
|
|
# for setup details.
|
|
|
|
#
|
2023-11-16 18:45:27 +01:00
|
|
|
# The output will be placed below /srv/www/htdocs/pgbadger/
|
|
|
|
#
|
|
|
|
# See https://github.com/darold/pgbadger/ for more details
|
|
|
|
#
|
2023-12-07 09:21:48 +01:00
|
|
|
#-0 4 * * * pgbadger /usr/bin/pgbadger -I -q /var/log/pgsql/postgresql-$(date "+%Y-%m-%d" -d "yesterday").log -O /srv/www/htdocs/pgbadger/
|
2023-11-16 18:45:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# The following example will generate a report every week using incremental behavior
|
|
|
|
#
|
2023-12-07 09:21:48 +01:00
|
|
|
#-0 4 * * 1 pgbadger /usr/bin/pgbadger -q `find /var/log/pgsql/ -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
|
2023-11-16 18:45:27 +01:00
|
|
|
|