Beginner here -- Working my way through initial set-up and have configured BorgBackup with a repo and some archives to do. All went OK, and I have done "manual" backups, however I am wondering if I need to set up a "cron" job/schedule to automate to the weekly backups I have stipulated in the archive setup ? If not, how can I tell what time and day of the week they are going to happen ? I've tried to find the "environmental variables" but have not bee able to locate them... The write-up in the OMV Wiki has not mention, nor does the original Borg documentation (that I could find...) Cheers and Happy New Year !
noob question -- BorgBackup Scheduling
-
- resolved
- njaimo
-
-
chente
Approved the thread. -
The backup jobs will be running automatically when you have the archives enabled in the archive tab. Cron jobs will be set for you.
Check out the omv-extras.org documentation and specifically the archives (create) section. It tells you when backup jobs will be run and how to customize the time. Customization is for all archives and works with offsets from the starting hour.
-
...found post https://forum.openmediavault.o…g-borgbackup-schedule%2F= ...not sure why it had not popped out on my search earlier...
I do not want to backup every hour, just every week -- so I was wondering when BorgBackup will do so -- like on what day, and at what time... I guess I'll find out once I start seeing the backups...
-
-
@erbsenzaehler Thank you for the note ! I will check as you suggest Cheers!
-
...not sure I understand.... I had read the omv-extras wiki earlier, and it is not very clear ...? below is the wiki blurb, and below that is my archive setting.... I am attempting to set it up to do once a week, and keep only the last 3 weekly backups...
...from the wiki page.. the example "yearly jobs start at 4" -- what does that mean ? is "4" the hour at which they start ? but then what month, and what day ? Same for the weekly example -- they start at 5 (4+1), is that 5 am ? or the fifth day ot the week at 2 am (as 2 am is the default ? ...not clear at all for a dumb noobie like me...
I assume I need to ssh to the server to find where the OMV_BORGBACKUP_STARTING_HOUR environmental variable is...?
Cheers!
-
Could you reply to this thread please? I wrote that document a long time ago but I see that you made a modification recently and I can't identify what it was. I'm not sure how to respond to the OP, sorry.
-
-
The setup you posted considers the archive as being weekly because of the first nonzero number from top to bottom (hourly, daily, weekly, monthly, yearly) being weekly 3. The weekly backups are being created on monday at starting hour + 1h. 3 of those weekly backups are retained.
Monthly jobs start on the first of every month.
Yearly jobs start on the first of January.
The times in the wiki are in 24h notation, so 4 means 4 am. The code below is the template for the cronjobs for borgbackup.
Log in to the server via ssh and alter the environment variable as described in the omv documentation, that way seems to be more elegant. Then do the omv-salt stuff as described in the screenshot of the omv-extras wiki.
Code: etc-cron_d-openmediavault-borgbackup.j2
Display More{%- set scriptsDir = '/var/lib/openmediavault/borgbackup' -%} {%- set startHour = salt['pillar.get']('default:OMV_BORGBACKUP_STARTING_HOUR', 2) | int -%} {%- set startHour2 = startHour + 1 -%} {{ pillar['headers']['multiline'] }} # This is the cron file for openmediavault-borgbackup. # m h dom mon dow user command 5 * * * * root run-parts {{ scriptsDir }}/hourly.d/ 30 {{ startHour2 }} * * * root run-parts {{ scriptsDir }}/daily.d/ 0 {{ startHour2 }} * * 1 root run-parts {{ scriptsDir }}/weekly.d/ 30 {{ startHour }} 1 * * root run-parts {{ scriptsDir }}/monthly.d/ 00 {{ startHour }} 1 1 * root run-parts {{ scriptsDir }}/yearly.d/
-
The weekly backups are being created on monday
How do you know or where can you see that they are created on Monday instead of Tuesday or Sunday? That's what I don't see clearly.
-
In the template it's dow=1 - that's Monday. (Notation is 0 for sunday going onwards)
I looked into the source code only a few days ago to check out why the basedir stuff wasn't working. That's why I know. -
-
In the template it's dow=1 - that's Monday. (Notation is 0 for sunday going onwards)
I looked into the source code only a few days ago to check out why the basedir stuff wasn't working. That's why I know.OK thanks. I guess that should be added somewhere on the wiki.
-
Maybe modify this:
QuoteExample: setting the starting hour to 4 would mean the following:
- yearly jobs start at 4
- monthly jobs start at 4:30 (4 + 30 mins)
- weekly jobs start at 5 (4 + 1 hour)
- daily jobs start at 5:30 (4 + 1 hour + 30 mins)
- hourly start at 5 mins after the hour every hour
Something like this:
QuoteExample: setting the starting hour to 4 would mean the following:
- yearly jobs start on January 1 at 4
- monthly jobs start on the first day of the month at 4:30 (4 + 30 mins)
- weekly jobs start on Mondays at 5 (4 + 1 hour)
- daily jobs start at 5:30 (4 + 1 hour + 30 mins)
- hourly start at 5 mins after the hour every hour
I will wait for confirmation from ryecoaaron to modify it.
-
I will wait for confirmation from ryecoaaron to modify it.
That is fine. I was just trying to explain the starting hour variable logic. But you changes are more accurate.
-
-
That is fine. I was just trying to explain the starting hour variable logic. But you changes are more accurate.
ok I already modified the wiki, thanks. https://wiki.omv-extras.org/do…lugins:borgbackup#create1
I would say that the OP's question is already answered, so I consider the thread resolved.
-
chente
Added the Label resolved -
MANY THANKS to All !!!!
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!