autorestic
autorestic copied to clipboard
Support Cron in docker image
This PR adds the ability to use cron inside the docker image. Autorestic Cronjob would run every minute, checking for any backups due in $CRON_CONFIG_DIR
Cron is only enabled if $CRON_CONFIG_DIR is set.
It wouldn't affect existing users, since they would override the CMD option with their custom Command.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/cupcakearmy/autorestic/HKgT4UL7kgf1VupvUPoJUNjseB5L
✅ Preview: https://autorestic-git-fork-fariszr-master-cupcakearmy.vercel.app
@cupcakearmy Anything stopping this from being merged ?
Hey there, not really and thanks for the contribution!! I need to test a few things but I'm having exams rn so don't have much time to test it. Can it wait until start of April?
Sure!, no problem. I would use my fork until this is merged.
Any updates? i got another PR pending on this to add the ability to manage docker containers from inside the container too, By adding the docker && docker compose if enabled.
Hey, i'm finally coming around to getting autorestic up to date again :) Will look at it tomorrow :)
There is something missing in the .dockerignore
file. Otherwise it won't build.
!/*.sh
Need to go out now, will check rest later :)
Fixed
What's up with this pull request, it seems everything is working is there a specific reason it still isn't merged? @cupcakearmy
I think having an image with cron built in will be useful to many. I do want to bring up that orchestration tools such as Kubernetes and Nomad have native ways for running reoccurring tasks, CronJob objects and the periodic job spec block, respectively. In these cases I think it would be nice to still provide an image that doesn't run cron. What do you think about updating this PR to build images both with and without cron?
I don't think building 2 images would be the optimal way. Implementing Cron and introducing a variable like ENABLE_CRON
with default set to false
would be sufficient and satisfy all requirements for any container orchestration platform.
The image now is practically unusable (except when using additional containers that execute it as a one-shot job) on Docker Swarm. Users who need Cron (where you can't use local Cron to launch it) are now basically stuck on Resticker, myself included.
@mihakrumpestar I use PremoWeb/chadburn to schedule ephemeral docker containers like autorestic.