Skip to content

Commit

Permalink
Merge pull request #28 from ElliottLandsborough/patch-1
Browse files Browse the repository at this point in the history
Add niceness option to profile
  • Loading branch information
tohuwabohu authored Nov 20, 2016
2 parents b7715ad + 25ee456 commit aab4950
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions manifests/profile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
# [*exec_after_source*]
# Source file to be used as the post-backup script
#
# [*niceness*]
# Nice value, -20 (most favorable scheduling) to 19 (least favorable) - disabled by default
#
# === Authors
#
# Martin Meinhold <Martin.Meinhold@gmx.de>
Expand Down Expand Up @@ -111,6 +114,7 @@
$exec_before_source = undef,
$exec_after_content = undef,
$exec_after_source = undef,
$niceness = undef,
) {
require duplicity

Expand Down Expand Up @@ -306,10 +310,17 @@
}

if versioncmp($real_duply_version, '1.7.1') < 0 {
$cron_command = "duply ${title} cleanup_backup_purge-full --force >> ${duplicity::duply_log_dir}/${title}.log"
$duply_command = "duply ${title} cleanup_backup_purge-full --force >> ${duplicity::duply_log_dir}/${title}.log"
}
else {
$duply_command = "duply ${title} cleanup_backup_purgeFull --force >> ${duplicity::duply_log_dir}/${title}.log"
}

if $niceness {
$cron_command = "nice -n ${niceness} ${duply_command}"
}
else {
$cron_command = "duply ${title} cleanup_backup_purgeFull --force >> ${duplicity::duply_log_dir}/${title}.log"
$cron_command = $duply_command
}

cron { "backup-${title}":
Expand Down

0 comments on commit aab4950

Please sign in to comment.