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

Added support for multiple / variable backup times. #92

Closed
wants to merge 4 commits into from
Closed

Added support for multiple / variable backup times. #92

wants to merge 4 commits into from

Conversation

sebastianberm
Copy link
Contributor

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

REFERENCE.md Outdated Show resolved Hide resolved
manifests/init.pp Outdated Show resolved Hide resolved
<% include stdlib -%>
<% $backuptime.keys.each | $key | { -%>
# Daily named job "<%= $key %>" at <%= $backuptime[$key] %>
OnCalendar=*-*-* <%= $backuptime[$key] %>
Copy link
Member

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?

Copy link
Contributor Author

@sebastianberm sebastianberm Feb 2, 2021

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.

bastelfreak pushed a commit to bastelfreak/puppet-borg that referenced this pull request Jul 20, 2021
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
```
bastelfreak pushed a commit to bastelfreak/puppet-borg that referenced this pull request Jul 20, 2021
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
```
@bastelfreak
Copy link
Member

Hi @sebastianberm, thanks for the PR. I rebased it and replaced the windows line endings with unix ones and resubmitted the code as #111

@sebastianberm
Copy link
Contributor Author

Hi @bastelfreak ,

Thanks!

I'll send in a new PR with support for SSH jumphosts soon :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scheduling the time the backup is ran
2 participants