Skip to content

Commit 19b139f

Browse files
committed
offset different backups time/hour so they wouldn't start at once
Offset the backup minute for the daily/weekly/monthy backups. This prevents the various backups from starting at the same time. Otherwise it would be a random chance over whether the daily or hourly script ran on any given day. Also changed the monthly backup from +6 to +7 from he backup hour. When using the default settings of running every other hour this will make sure the monthly backup never starts at the same hour as an hourly one.
1 parent 03c7c5d commit 19b139f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

manifests/server/config.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,24 @@
9595
command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} daily",
9696
user => $server_user,
9797
hour => $backup_time_hour,
98-
minute => $backup_time_minute
98+
minute => ($backup_time_minute + 50) % 60
9999
} ->
100100

101101
## weekly
102102
cron { "rsnapshot-${name}-weekly" :
103103
command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} weekly",
104104
user => $server_user,
105105
hour => ($backup_time_hour + 3) % 24,
106-
minute => $backup_time_minute,
106+
minute => ($backup_time_minute + 50) % 60,
107107
weekday => $backup_time_weekday
108108
} ->
109109

110110
## monthly
111111
cron { "rsnapshot-${name}-monthly" :
112112
command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} monthly",
113113
user => $server_user,
114-
hour => ($backup_time_hour + 6) % 24,
115-
minute => $backup_time_minute,
114+
hour => ($backup_time_hour + 7) % 24,
115+
minute => ($backup_time_minute + 50) % 60,
116116
monthday => $backup_time_dom
117117
}
118118

0 commit comments

Comments
 (0)