rsync: bug fixes.
This commit is contained in:
parent
faa453c544
commit
a8a1ba59a0
2 changed files with 12 additions and 6 deletions
|
@ -144,7 +144,8 @@ define rsync::backup_job (
|
|||
false => $source_dirs,
|
||||
}
|
||||
$_source = "${source_host}:${_source_dirs}"
|
||||
} elsif $source_dir {
|
||||
$_log_host = $source_host
|
||||
} elsif $source_dirs {
|
||||
$_source = is_array($source_dirs) ? {
|
||||
true => inline_template("<%= @source_dirs.join(\" \") -%>"),
|
||||
false => $source_dirs,
|
||||
|
@ -155,17 +156,22 @@ define rsync::backup_job (
|
|||
|
||||
if $target_host and $target_dir {
|
||||
$_target = "${target_host}:${target_dir}"
|
||||
$_log_host = $target_host
|
||||
} elsif $target_dir {
|
||||
$_target = "${target_dir}"
|
||||
} else {
|
||||
fail("You need to specify target_dir (and optionally target_host)")
|
||||
}
|
||||
|
||||
if !$_log_host {
|
||||
$_log_host = "localhost"
|
||||
}
|
||||
|
||||
if is_array($excludes) {
|
||||
$_excludes = inline_template('<%= @excludes.map {|x| "--exclude=\"" + x + "\""}.join(" ") -%>')
|
||||
$_excludes = inline_template('<%= @excludes.map {|x| "--exclude \'" + x + "\'"}.join(" ") -%>')
|
||||
} elsif $excludes {
|
||||
# We assume string here
|
||||
$_excludes = '--exclude="$excludes"'
|
||||
$_excludes = "--exclude='$excludes'"
|
||||
} else {
|
||||
$_excludes = ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue