Skip to content

Commit

Permalink
Merge pull request #19 from kentjohansson/issue17_fix_cron_dump_database
Browse files Browse the repository at this point in the history
Fix dump_dashboard_database and redirect output
  • Loading branch information
ghoneycutt committed Sep 11, 2013
2 parents 64fe83e + 55a7080 commit 4916579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifests/dashboard/maintenance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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: }
Expand Down

0 comments on commit 4916579

Please sign in to comment.