Closed televisi closed 5 months ago
I'd recommend trying the CRON
, CRON_COMMAND
and EXTRA_CRON
variables to see if that works better for you.
Make sure to remove the contab.
This makes it much easier to modify as you wish during testing as you can just bring the compose file up again.
Example:
environment:
TZ: $TZ
CRON: 0 5 * * *
CRON_COMMAND: borgmatic --stats -v 0
EXTRA_CRON: |-
0 5 2 * * command1
0 7 1 * * command2
More info: https://github.com/modem7/docker-borgmatic?tab=readme-ov-file#environment-variables
Thanks for your prompt reply!
Okay, I just gave this a try:
CRON=*/3 1 * * *
CRON_COMMAND=borgmatic --stats -v 0 --log-file /etc/borgmatic.d/log/borgmatic.log --log-file-verbosity 1 2>&1
EXTRA_CRON=*/5 * * * * bash -c 'logrotate /etc/borgmatic.d/logrotate.conf'
Unfortunately, it didn't work. When I checked the /etc/borgmatic.d/ folder, seems the crontab.txt is created again, with this content:
0 1 * * * PATH=$PATH:/usr/local/bin /usr/local/bin/borgmatic --stats -v 0 2>&1
Log:
INFO[2024-01-30T07:51:00+11:00] read crontab: /etc/borgmatic.d/crontab.txt
INFO[2024-01-30T07:51:00+11:00] crontab is valid
The variable SUPERCRONIC_EXTRA_FLAGS is empty, starting normally
INFO[2024-01-30T07:51:00+11:00] read crontab: /etc/borgmatic.d/crontab.txt
SUPERCRONIC_EXTRA_FLAGS
?
Could you double-check which image you're using?
Could you double-check which image you're using?
Ugh! you're right, I was using the other image from borgmatic-collective; ugh! sorry!
I have found your wiki was super useful and didn't realise that I use the image from the other one.
I'll reach out to the other github for this issue and closing this one.
Thank you! Glad the wiki helped!
You can use either, but they both have different variables available.
I'm one of the maintainer in the main repo, but there were a few things I'm using in mine that the other hasn't yet got.
So they'd both work similarly, but have slightly different behaviour depending on the config (eg this one has docker, different cron job settings, s6 etc).
Neither one is better than the other, but they cater to different use cases.
Hi,
This might not likely an issue, but more a discussion; but because I cannot see 'discussions' tab on your github, I raised it under 'issue' instead.
As part of the testing, I wanted to have borgmatic to run every 3 minutes followed with logrotate command every 5 minutes.
On \etc\borgmatic.d\crontab.txt file, I have the following
When I checked docker log, it only ran the logrotate every 5 minutes, but does not run the borgmatic; did I miss anything here?
Thanks