-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added support for multiple / variable backup times. #92
Conversation
templates/borg-backup.timer.epp
Outdated
<% include stdlib -%> | ||
<% $backuptime.keys.each | $key | { -%> | ||
# Daily named job "<%= $key %>" at <%= $backuptime[$key] %> | ||
OnCalendar=*-*-* <%= $backuptime[$key] %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add a unit test that verifies the file content is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a couple of unit tests to verify the syntax and processing (also processing of multiple backuptimes), but I am not experienced with rspec-puppet to be able to actually verify the correct OnCalendar output.
Would you be able to help me a bit with this (or direct me to the documentation on how I can verify the File in a dependant function call (*) )?
(*) What I mean is, the camptocamp/systemd is a dependancy of this module, which is not a problem, but I don't know how to verify the content of the EPP with this.
Fixes voxpupuli#91 replaces voxpupuli#92 This now looks as this: ``` --- /etc/systemd/system/borg-backup.timer 2021-07-12 13:35:20.895432545 +0200 +++ /tmp/puppet-file20210720-108100-1p92i82 2021-07-20 09:46:01.670324290 +0200 @@ -1,11 +1,11 @@ # THIS FILE IS MANAGED BY PUPPET [Unit] -Description=Daily Timer for borg-backup +Description=Daily Timer(s) for borg-backup [Timer] # OnBootSec=10min # OnUnitActiveSec=1d -# Daily at 8am +# Daily named job "default" at 18:30:00 OnCalendar=*-*-* 18:30:00 Persistent=True ```
Fixes voxpupuli#91 replaces voxpupuli#92 This now looks as this: ``` --- /etc/systemd/system/borg-backup.timer 2021-07-12 13:35:20.895432545 +0200 +++ /tmp/puppet-file20210720-108100-1p92i82 2021-07-20 09:46:01.670324290 +0200 @@ -1,11 +1,11 @@ # THIS FILE IS MANAGED BY PUPPET [Unit] -Description=Daily Timer for borg-backup +Description=Daily Timer(s) for borg-backup [Timer] # OnBootSec=10min # OnUnitActiveSec=1d -# Daily at 8am +# Daily named job "default" at 18:30:00 OnCalendar=*-*-* 18:30:00 Persistent=True ```
Hi @sebastianberm, thanks for the PR. I rebased it and replaced the windows line endings with unix ones and resubmitted the code as #111 |
Hi @bastelfreak , Thanks! I'll send in a new PR with support for SSH jumphosts soon :-). |
Pull Request (PR) description
This PR will allow users to set the times where systemd would need to run the backup, this will also allow multiple backups to be run each day, so the load can be distributed.
Furthermore, the original backup time is no longer hardcoded at 18:30:00.
This Pull Request (PR) fixes the following issues
Fixes #91