Commit a9e4f0b5 authored by Jerome Charaoui's avatar Jerome Charaoui

Merge branch 'merge_mayfirst' into 'master'

Merge mayfirst

(almost) Last branch that needs to be merged in. This work is 3 years old

See merge request !1
parents 21d8dc86 b2c9640c
......@@ -18,3 +18,21 @@ define backupninja::config(
mode => 0644
}
}
# Write the backupninja cron job, allowing you to specify an alternate backupninja
# command (if you want to wrap it in any other commands, e.g. to allow it to use
# the monkeysphere for authentication), or a different schedule to run it on.
define backupninja::cron(
$backupninja_cmd = '/usr/sbin/backupninja',
$backupninja_test_cmd = $backupninja_cmd,
$cronfile = "/etc/cron.d/backupninja",
$min = "0", $hour = "*", $dom = "*", $month = "*",
$dow = "*")
{
file { $cronfile:
content => template('backupninja/backupninja.cron.erb'),
owner => root,
group => root,
mode => 0644
}
}
......@@ -18,7 +18,8 @@ define backupninja::mysql(
$order = 10, $ensure = present, $user = false, $dbusername = false, $dbpassword = false,
$dbhost = 'localhost', $databases = 'all', $backupdir = false, $hotcopy = false,
$sqldump = false, $compress = false, $configfile = true,
$vsname = false, $sqldumpoptions = '--lock-tables --complete-insert --add-drop-table --quick --quote-names')
$vsname = false, $sqldumpoptions = '--lock-tables --complete-insert --add-drop-table --quick --quote-names',
$nodata = false)
{
$real_configfile = $configfile ? {
......
# /etc/cron.d/backupninja -- cron tab entry for package backupninja
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# # run backupninja
<%= min %> <%= hour %> <%= dom %> <%= month %> <%= dow %> root if [ -x <%= backupninja_test_cmd %> ]; then <%= backupninja_cmd %>; fi
......@@ -16,3 +16,10 @@ compress = <%= compress ? 'yes' : 'no' %>
<% if real_configfile %>
configfile = <%= real_configfile %>
<% end %>
<% if nodata.is_a? String -%>
<%= 'nodata = ' + nodata %>
<% elsif nodata.is_a? Array -%>
<%= "nodata = " + nodata.map { |i| "#{i}" }.join(" ") %>
<% end -%>
......@@ -4,8 +4,10 @@ vsname = <%= vsname %>
<% if backupdir %>
backupdir = <%= backupdir %>
<% end %>
<% if databases %>
databases = <%= databases %>
<% end %>
<% if databases.is_a? String -%>
<%= 'databases = ' + databases %>
<% elsif databases.is_a? Array -%>
<%= "databases = " + databases.map { |i| "#{i}" }.join(" ") %>
<% end -%>
compress = <%= compress ? 'yes' : 'no' %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment