From 55a70806f6b25bba6d03a5104221e43b0413a015 Mon Sep 17 00:00:00 2001 From: Kent J Date: Tue, 10 Sep 2013 10:30:51 +0200 Subject: [PATCH] Fix dump_dashboard_database and redirect output --- manifests/dashboard/maintenance.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/dashboard/maintenance.pp b/manifests/dashboard/maintenance.pp index 1a952be..930080a 100755 --- a/manifests/dashboard/maintenance.pp +++ b/manifests/dashboard/maintenance.pp @@ -12,7 +12,7 @@ $purge_old_reports_hour = '0', $purge_old_reports_minute = '30', $dump_dir = '/var/local', - $dump_database_command = 'sudo -u puppet-dashboard /usr/bin/rake -f /usr/share/puppet-dashboard/Rakefile RAILS_ENV=production FILE=/var/local/dashboard-`date -I`.sql db:raw:dump >> /var/log/puppet/dashboard_maintenance.log && bzip2 -v9 /var/local/dashboard-`date -I`.sql >> /var/log/puppet/dashboard_maintenance.log', + $dump_database_command = 'cd ~puppet-dashboard && sudo -u puppet-dashboard /usr/bin/rake -f /usr/share/puppet-dashboard/Rakefile RAILS_ENV=production FILE=/var/local/dashboard-`date -I`.sql db:raw:dump >> /var/log/puppet/dashboard_maintenance.log 2>&1 && bzip2 -v9 /var/local/dashboard-`date -I`.sql >> /var/log/puppet/dashboard_maintenance.log 2>&1', $dump_database_user = 'root', $dump_database_hour = '1', $dump_database_minute = '0', @@ -34,7 +34,7 @@ if $dump_dir == '/var/local' { $my_dump_database_command = $dump_database_command } else { - $my_dump_database_command = "sudo -u puppet-dashboard /usr/bin/rake -f /usr/share/puppet-dashboard/Rakefile RAILS_ENV=production FILE=${dump_dir}/dashboard-`date -I`.sql db:raw:dump >> /var/log/puppet/dashboard_maintenance.log && bzip2 -v9 ${dump_dir}/dashboard-`date -I`.sql >> /var/log/puppet/dashboard_maintenance.log" + $my_dump_database_command = "cd ~puppet-dashboard && sudo -u puppet-dashboard /usr/bin/rake -f /usr/share/puppet-dashboard/Rakefile RAILS_ENV=production FILE=${dump_dir}/dashboard-`date -I`.sql db:raw:dump >> /var/log/puppet/dashboard_maintenance.log 2>&1 && bzip2 -v9 ${dump_dir}/dashboard-`date -I`.sql >> /var/log/puppet/dashboard_maintenance.log 2>&1" } common::mkdir_p { $dump_dir: }