-
Notifications
You must be signed in to change notification settings - Fork 95
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
Move to S6 switched crond to busybox instead of supercronic. #321
Comments
It seems that commit 670f70e is the trigger. |
I consider it a bug that supercronic was accidentally (?!) removed. My error output looks like this:
|
@modem7 did we mean to strip supercronic out? |
@grantbevis yes, the only reason supercronic was in was to address the sigterm issue which it didn't really do anyway. Since moving to s6, it's less maintenence and more reliable to remove supercronic and use the inbuilt cron system. We need to update and go through the readme and update since we're missing a few things. |
A migration guide would be great because it seems that the cron syntax is different. |
The main difference between cron and supercronic is that supercronic allows for second resolution schedules as it uses the cronexpr package (so it accepts seconds and years), giving a 6-7 digit expression (2 of which are optional), whereas standard cron is typically 5 digits (minutes, hours, days, month, day of week).
To migrate, just make it first resolution (5 digits, instead of 6 or 7). Using something like crobtab guru is useful in this endeavour. |
Thanks bro @modem7 |
It seems it is not that easy to move an existing crontab to s6. I changed the number of fields from 6 to 5 but yet I get a strange error at startup.
crontab.txt:
Only after stripping down the crontab to the following reduced version it worked again.
I suspect that something does parse anymore in combination with the date command (the only thing containing a Y). But I am clueless what the problem really is. Help to get the crontab working again would be highly appreciated. :) |
Could you paste your compose file? When I'm back home I'll take a look . |
That's my compose file. I only cut down the backup source paths.
|
OK, I think I've found the issue. I'm going to raise a PR, and we'll need to change your crontab as well to work a bit better. |
I've raised #322. @grantbevis could you review and authorise? Single line change. To make this work better, change the crontab to be:
Better yet, in the new build, you can even have this as env vars, fully eliminating your crontab: borgmatic:
# image: modem7/borgmatic-docker
image: borgmatic:test
container_name: Borgmatic
environment:
TZ: $TZ
BORG_PASSPHRASE: $BORG_PASSPHRASE
BORG_SOURCE_1: $BORG_SOURCE_1
BORG_SOURCE_2: $BORG_SOURCE_2
BORG_REPO: $BORG_REPO
BORG_HEALTHCHECK_URL: $BORG_HEALTHCHECK_URL
CRON: "0 8-22/1 * * *"
DOCKERCLI: true
CRON_COMMAND: "borgmatic prune compact create --files --stats -v 1 2>&1 > tee /mnt/log/backup-$(date +%Y-%m-%dT%H:%M:%S).log"
EXTRA_CRON: "@daily borgmatic check -v 1 2>&1 > tee /mnt/log/check-$(date +%Y-%m-%dT%H:%M:%S).log" Once the PR is merged, this is the result I'm getting: Installing Docker CLI...
Software Versions:
-----------------------------------
apprise 1.7.6
borg 1.2.8
borgmatic 1.8.10
dockercli 25.0.5
python 3.12.3
-----------------------------------
Time Zone: Europe/London
-----------------------------------
Applying custom cron
Cron job set as:
0 8-22/1 * * * borgmatic prune compact create --files --stats -v 1 2>&1 > tee /mnt/log/backup-$(date +%Y-%m-%dT%H:%M:%S).log
@daily borgmatic check -v 1 2>&1 > tee /mnt/log/check-$(date +%Y-%m-%dT%H:%M:%S).log
crond: crond (busybox 1.36.1) started, log level 8 |
#322 Is merged |
@MarkJonas - Does this work for you? |
1.8.10 seems to break cron. See borgmatic-collective/docker-borgmatic#321 for more info. Updating once fix is released.
@modem7 Thank you for your help. I tried the modified crontab.txt (replace backticks with $()) and it still does not work with 1.8.10.
Next, I switched to latest and there it works.
Thank you very much! 👍 I now want to scan through the documentation and read more about your proposal to remove the crontab.txt and use the environment parameters instead. At a quick glance I did not find documentation e.g. for |
Heya, Yes, the readme needs an overhaul as we've have a lot of changes in a short period of time. But effectively, it merely transposes cron from a file to a variable which can be much more easily changed. The cron logic in docker-borgmatic/root/etc/s6-overlay/s6-rc.d/svc-cron/run Lines 90 to 113 in be6bf72
The downside is that multiple line cron jobs can get complicated. |
Supercronic is not getting run anymore and instead it's busybox crond. Documentation still seems to point towards using supercronic so I'm assuming this is a bug of some sort?
The text was updated successfully, but these errors were encountered: