]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/manifests/postgresql/backup_dump.pp
Fix crontab command % escape
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / postgresql / backup_dump.pp
index 5e469c5c213c893afef1fb8cd1164c26155e080e..fcc2085883ce05f5a043721c966f6386f7c155fd 100644 (file)
@@ -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,
@@ -60,10 +60,10 @@ define profile::postgresql::backup_dump (
 
   @profile::monitoring::local_service { "Last postgresql dump in $pg_backup_path is not too old":
     sudos => {
-      "naemon-postgresql-dumps" => "naemon  ALL=($pg_user) NOPASSWD: /usr/bin/find $pg_backup_path -mindepth 1 -maxdepth 1 -printf %T@\\n",
-    }
+      "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!10!$pg_user"
+      check_command => "check_last_file_date!$pg_backup_path!7!$pg_user",
     }
   }
 }