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

Support Cron in docker image #172

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

FarisZR
Copy link
Contributor

@FarisZR FarisZR commented Mar 19, 2022

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.

@vercel
Copy link

vercel bot commented Mar 19, 2022

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

@FarisZR
Copy link
Contributor Author

FarisZR commented Mar 22, 2022

@cupcakearmy Anything stopping this from being merged ?

@cupcakearmy
Copy link
Owner

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?

@FarisZR
Copy link
Contributor Author

FarisZR commented Mar 22, 2022

Sure!, no problem.
I would use my fork until this is merged.

@FarisZR
Copy link
Contributor Author

FarisZR commented Apr 12, 2022

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.

@cupcakearmy
Copy link
Owner

Hey, i'm finally coming around to getting autorestic up to date again :) Will look at it tomorrow :)

@cupcakearmy
Copy link
Owner

There is something missing in the .dockerignore file. Otherwise it won't build.

!/*.sh

Need to go out now, will check rest later :)

@FarisZR
Copy link
Contributor Author

FarisZR commented Apr 23, 2022

Fixed

@tom2199
Copy link

tom2199 commented Jan 3, 2023

What's up with this pull request, it seems everything is working is there a specific reason it still isn't merged? @cupcakearmy

@drewgingerich
Copy link

drewgingerich commented Mar 23, 2023

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?

@mihakrumpestar
Copy link

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.

@mpfl
Copy link
Contributor

mpfl commented Dec 22, 2023

@mihakrumpestar I use PremoWeb/chadburn to schedule ephemeral docker containers like autorestic.

@nlitz88
Copy link

nlitz88 commented Aug 24, 2024

Any update on this? This feature would still be very useful!

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

Successfully merging this pull request may close these issues.

7 participants