Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job var "Max Full Interval" #159

Merged
merged 3 commits into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ Define a Bacula [Job resource] resource which can create new
- `selection_type`: determines how a copy/migration job will go about selecting what JobIds to migrate
- `selection_pattern`: gives you fine control over exactly what JobIds are selected for a copy/migration job.
- `write_bootstrap`: allows you to specify where a bootstrap file should be written after backup.
- `max_full_interval`: The time specifies the maximum allowed age of
the most recent successful Full backup. Defaults to `0`. Bacula `Max Full Interval` directive

See also `bacula::jobdefs`.

Expand Down Expand Up @@ -267,6 +269,8 @@ Define a Bacula [JobDefs resource] resource. Parameters are:
`Reschedule Interval` directive.
- `reschedule_times`: The number of retries for failed jobs. Bacula
`Reschedule Times` directive.
- `max_full_interval`: The time specifies the maximum allowed age of
the most recent successful Full backup. Defaults to `0`. Bacula `Max Full Interval` directive

### bacula::messages

Expand Down
16 changes: 16 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,14 @@ The writebootstrap directive specifies a file name where Bacula will write a boo

Default value: ``undef``

##### `max_full_interval`

Data type: `Optional[String]`

The time specifies the maximum allowed age (counting from start time) of the most recent successful Full backup that is required in order to run Incremental or Differential backup jobs. f the most recent Full backup is older than this interval, Incremental and Differential backups will be upgraded to Full backups automatically.

Default value: ``undef``

### `bacula::jobdefs`

This define adds a jobdefs entry on the bacula director for reference by the client configurations.
Expand Down Expand Up @@ -1533,6 +1541,14 @@ The writebootstrap directive specifies a file name where Bacula will write a boo

Default value: ``undef``

##### `max_full_interval`

Data type: `Optional[String]`

The time specifies the maximum allowed age (counting from start time) of the most recent successful Full backup that is required in order to run Incremental or Differential backup jobs. f the most recent Full backup is older than this interval, Incremental and Differential backups will be upgraded to Full backups automatically.

Default value: ``undef``

### `bacula::messages`

Create a Messages resource on the $daemon (director, storage or file).
Expand Down
3 changes: 3 additions & 0 deletions manifests/job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# @param selection_pattern Pattern to match against to filter items with selection_type
# @param max_concurrent_jobs Maximum number of Jobs from the current Job resource that can run concurrently
# @param write_bootstrap The writebootstrap directive specifies a file name where Bacula will write a bootstrap file for each Backup job run
# @param max_full_interval The time specifies the maximum allowed age (counting from start time) of the most recent successful Full backup that is required in order to run Incremental or Differential backup jobs. f the most recent Full backup is older than this interval, Incremental and Differential backups will be upgraded to Full backups automatically.
#
# @example
# bacula::job { "${fqdn}-common":
Expand Down Expand Up @@ -67,6 +68,7 @@
Optional[String] $selection_pattern = undef,
Integer $max_concurrent_jobs = 1,
Optional[String] $write_bootstrap = undef,
Optional[String] $max_full_interval = undef,
) {
include bacula
include bacula::client
Expand Down Expand Up @@ -127,6 +129,7 @@
reschedule_interval => $reschedule_interval,
reschedule_times => $reschedule_times,
write_bootstrap => $write_bootstrap,
max_full_interval => $max_full_interval,
}

@@bacula::director::job { $name:
Expand Down
3 changes: 3 additions & 0 deletions manifests/jobdefs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# @param reschedule_times This directive specifies the maximum number of times to reschedule the job
# @param max_concurrent_jobs Maximum number of Jobs from the current Job resource that can run concurrently
# @param write_bootstrap The writebootstrap directive specifies a file name where Bacula will write a bootstrap file for each Backup job run
# @param max_full_interval The time specifies the maximum allowed age (counting from start time) of the most recent successful Full backup that is required in order to run Incremental or Differential backup jobs. f the most recent Full backup is older than this interval, Incremental and Differential backups will be upgraded to Full backups automatically.
#
define bacula::jobdefs (
Bacula::JobType $jobtype = 'Backup',
Expand All @@ -32,6 +33,7 @@
Integer $reschedule_times = 10,
Integer $max_concurrent_jobs = 1,
Optional[String] $write_bootstrap = undef,
Optional[String] $max_full_interval = undef,
) {
include bacula
$conf_dir = $bacula::conf_dir
Expand All @@ -52,6 +54,7 @@
reschedule_interval => $reschedule_interval,
reschedule_times => $reschedule_times,
write_bootstrap => $write_bootstrap,
max_full_interval => $max_full_interval,
}

concat::fragment { "bacula-jobdefs-${name}":
Expand Down
48 changes: 26 additions & 22 deletions templates/job.conf.epp
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<%
|
String $name,
Bacula::JobType $jobtype,
String $fileset_real,
Optional[String] $pool,
Optional[String] $storage,
Optional[String] $restoredir,
Optional[String] $messages,
Optional[String] $pool_full,
Optional[String] $pool_inc,
Optional[String] $pool_diff,
Optional[String] $selection_type,
Optional[String] $selection_pattern,
Variant[Boolean,String] $jobdef,
String $name,
Bacula::JobType $jobtype,
String $fileset_real,
Optional[String] $pool,
Optional[String] $storage,
Optional[String] $restoredir,
Optional[String] $messages,
Optional[String] $pool_full,
Optional[String] $pool_inc,
Optional[String] $pool_diff,
Optional[String] $selection_type,
Optional[String] $selection_pattern,
Variant[Boolean,String] $jobdef,
Array[Bacula::Runscript] $runscript,
Bacula::Yesno $accurate,
Optional[String] $level,
Optional[String] $sched,
Optional[Integer] $priority,
Optional[Integer] $max_concurrent_jobs,
Bacula::Yesno $reschedule_on_error,
Bacula::Time $reschedule_interval,
Integer $reschedule_times,
Optional[String] $write_bootstrap,
Bacula::Yesno $accurate,
Optional[String] $level,
Optional[String] $sched,
Optional[Integer] $priority,
Optional[Integer] $max_concurrent_jobs,
Bacula::Yesno $reschedule_on_error,
Bacula::Time $reschedule_interval,
Integer $reschedule_times,
Optional[String] $write_bootstrap,
Optional[String] $max_full_interval,
|
-%>
Job {
Expand Down Expand Up @@ -103,6 +104,9 @@ Job {
<% if $write_bootstrap { -%>
Write Bootstrap = <%= $write_bootstrap %>
<% } -%>
<% if $max_full_interval { -%>
Max Full Interval = <%= $max_full_interval %>
<% } -%>

}

26 changes: 15 additions & 11 deletions templates/jobdefs.conf.epp
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<%
|
String $name,
Bacula::JobType $jobtype,
String $pool,
Optional[String] $full_backup_pool,
Optional[String] $differential_backup_pool,
String $sched,
String $messages,
Integer $priority,
Bacula::Yesno $accurate,
Optional[String] $level,
String $name,
Bacula::JobType $jobtype,
String $pool,
Optional[String] $full_backup_pool,
Optional[String] $differential_backup_pool,
String $sched,
String $messages,
Integer $priority,
Bacula::Yesno $accurate,
Optional[String] $level,
Optional[Integer] $max_concurrent_jobs,
# Used in bacula/_job_reschedule.epp
Bacula::Yesno $reschedule_on_error,
Bacula::Time $reschedule_interval,
Integer $reschedule_times,
Optional[String] $write_bootstrap,
Optional[String] $write_bootstrap,
Optional[String] $max_full_interval,
|
-%>
JobDefs {
Expand All @@ -41,5 +42,8 @@ JobDefs {
<% if $write_bootstrap { -%>
Write Bootstrap = <%= $write_bootstrap %>
<% } -%>
<% if $max_full_interval { -%>
Max Full Interval = <%= $max_full_interval %>
<% } -%>
<%= epp('bacula/_job_reschedule.epp', { reschedule_on_error => $reschedule_on_error, reschedule_interval => $reschedule_interval, reschedule_times => $reschedule_times }) -%>
}