mirror of https://github.com/zulip/zulip.git
wal-g: Write out a logfile.
Otherwise, this output goes into `/var/spool/mail/postgres`, which is not terribly helpful. We do not write to `/var/log/zulip` because the backup runs as the `postgres` user, and `/var/log/zulip` is owned by zulip and chmod 750.
This commit is contained in:
parent
67f3cb67c5
commit
2f4775ba68
|
@ -1,3 +1,3 @@
|
||||||
PATH=/bin:/usr/bin:/usr/local/bin
|
PATH=/bin:/usr/bin:/usr/local/bin
|
||||||
|
|
||||||
0 2 * * * postgres /usr/local/bin/pg_backup_and_purge
|
0 2 * * * postgres /usr/local/bin/pg_backup_and_purge >/var/log/pg_backup_and_purge.log 2>&1
|
||||||
|
|
|
@ -4,6 +4,12 @@ class zulip::postgresql_backups {
|
||||||
include zulip::postgresql_common
|
include zulip::postgresql_common
|
||||||
include zulip::wal_g
|
include zulip::wal_g
|
||||||
|
|
||||||
|
file { '/var/log/pg_backup_and_purge.log':
|
||||||
|
ensure => file,
|
||||||
|
owner => 'postgres',
|
||||||
|
group => 'postgres',
|
||||||
|
mode => '0644',
|
||||||
|
}
|
||||||
file { '/usr/local/bin/pg_backup_and_purge':
|
file { '/usr/local/bin/pg_backup_and_purge':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
|
@ -38,7 +44,10 @@ class zulip::postgresql_backups {
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
source => 'puppet:///modules/zulip/cron.d/pg-backup-and-purge',
|
source => 'puppet:///modules/zulip/cron.d/pg-backup-and-purge',
|
||||||
require => File['/usr/local/bin/pg_backup_and_purge'],
|
require => [
|
||||||
|
File['/var/log/pg_backup_and_purge.log'],
|
||||||
|
File['/usr/local/bin/pg_backup_and_purge'],
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${zulip::common::nagios_plugins_dir}/zulip_postgresql_backups":
|
file { "${zulip::common::nagios_plugins_dir}/zulip_postgresql_backups":
|
||||||
|
|
Loading…
Reference in New Issue