Skip to content

Support Cron in docker image - #172

Open
FarisZR wants to merge 6 commits into
cupcakearmy:masterfrom
FarisZR:master
Open

Support Cron in docker image#172
FarisZR wants to merge 6 commits into
cupcakearmy:masterfrom
FarisZR:master

Conversation

@FarisZR

@FarisZR FarisZR commented Mar 19, 2022

Copy link
Copy Markdown
Contributor

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

vercel Bot commented Mar 19, 2022

Copy link
Copy Markdown

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

FarisZR commented Mar 22, 2022

Copy link
Copy Markdown
Contributor Author

@cupcakearmy Anything stopping this from being merged ?

@cupcakearmy

Copy link
Copy Markdown
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

FarisZR commented Mar 22, 2022

Copy link
Copy Markdown
Contributor Author

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

@FarisZR

FarisZR commented Apr 12, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Owner

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

@cupcakearmy

Copy link
Copy Markdown
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

FarisZR commented Apr 23, 2022

Copy link
Copy Markdown
Contributor Author

Fixed

@tom2199

tom2199 commented Jan 3, 2023

Copy link
Copy Markdown

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

@drewgingerich

drewgingerich commented Mar 23, 2023

Copy link
Copy Markdown

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
Copy Markdown

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

mpfl commented Dec 22, 2023

Copy link
Copy Markdown
Contributor

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

@nlitz88

nlitz88 commented Aug 24, 2024

Copy link
Copy Markdown

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

@thomaswienecke

Copy link
Copy Markdown

Hey @cupcakearmy. Is there anything I could help with to get this PR merged?

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.

8 participants