X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprofile%2Fmanifests%2Fpostgresql%2Fbackup_dump.pp;h=fcc2085883ce05f5a043721c966f6386f7c155fd;hb=f7ef7ce7f8d596d38739c5e96623e8630e1036ae;hp=53fb20ee0b3b2336ac7e3fd241252ceb09f44833;hpb=ffcffbcb52dad28d28a0d36c989182e0716edd53;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/profile/manifests/postgresql/backup_dump.pp b/modules/profile/manifests/postgresql/backup_dump.pp index 53fb20e..fcc2085 100644 --- a/modules/profile/manifests/postgresql/backup_dump.pp +++ b/modules/profile/manifests/postgresql/backup_dump.pp @@ -49,7 +49,7 @@ define profile::postgresql::backup_dump ( description => "Cleanup the database backups", }, { - command => "cd $pg_backup_path ; /usr/bin/rm -f $(ls -1 *T22*.sql | log2rotate --skip 7 --fuzz 7 --delete --format='%Y-%m-%dT%H:%M:%S+02:00.sql')", + command => "cd $pg_backup_path ; /usr/bin/rm -f $(ls -1 *T22*.sql | log2rotate --skip 7 --fuzz 7 --delete --format='\%Y-\%m-\%dT\%H:\%M:\%S+02:00.sql')", user => $pg_user, hour => 3, minute => 1, @@ -57,4 +57,13 @@ define profile::postgresql::backup_dump ( }, ] } + + @profile::monitoring::local_service { "Last postgresql dump in $pg_backup_path is not too old": + sudos => { + "naemon-postgresql-dumps-$pg_host" => "naemon ALL=($pg_user) NOPASSWD: /usr/bin/find $pg_backup_path -mindepth 1 -maxdepth 1 -printf %T@?n", + }, + local => { + check_command => "check_last_file_date!$pg_backup_path!7!$pg_user", + } + } }