Sign inSign up

stevenmassaro/recurring-task-base

By stevenmassaro

•Updated 4 days ago

Docker image that runs a command with a specified delay

Image
0

2.0K

stevenmassaro/recurring-task-base repository overview

⁠Recurring Task Docker Base

ci Docker

A simple Docker image that repeatedly runs a command with a specified delay.

⁠Usage

⁠As a standalone image
⁠Environment variables:
NameRequiredDefault valueExample valueDescription
COMMANDYesecho Hello
AFTER_COMMANDNoecho Hello afterCommand that should be executed after COMMAND
RETRIESNo03Number of times to retry COMMAND after a nonzero exit code. Retries stop immediately after a successful attempt.
RETRY_BACKOFFNo05Initial retry delay in seconds. The delay doubles after each failed attempt (5 seconds, then 10, then 20, and so on).
DELAYNo1d7d (or any other permissible value for the sleep command)
ADJUST_FOR_RUNTIMENotruefalseIf set to true, subtracts the execution time of the task from the delay, ensuring the scheduler runs at consistent intervals (e.g., the same time each day).
CHECK_LAST_RUNTIMENofalsetrueIf set to true, checks when the task last ran and waits if needed to ensure the specified delay has passed since the last execution.
LAST_RUNTIME_FILENo/tmp/last_runtime/var/log/last_runtimeFile to store the timestamp of the last execution when CHECK_LAST_RUNTIME is enabled.
HEALTHCHECKS_URLNohttps://hc-ping.com/your-uuidIf set, sends ping to healthchecks.io before and after each command attempt (success or fail).
⁠As the base image of another project

See this project⁠ for an example of how to use this image as your base docker image.

Tag summary

Content type

Image

Digest

sha256:6c59c1a18…

Size

9.3 MB

Last updated

4 days ago

docker pull stevenmassaro/recurring-task-base