Official docker image for the crooner rust cron utility tool
3.8K
Go to github project to see full documentation agjini/crooner.
Crooner is a small utility written in Rust that allows scheduling Docker commands to be executed on containers (typically to perform database dumps within a Docker Compose setup).
services:
crooner:
image: agjini/crooner:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config.toml:/app/config.toml:ro
- ./backup:/backup
restart: unless-stopped
Create a config.toml file:
[[jobs]]
name = "PostgreSQL Backup"
at = "0 0 2 * * *" # Every day at 2:00 AM
container = "postgres-container"
command = ["pg_dump", "-U", "postgres", "mydb"]
output_file = "/backup/postgres_backup.sql"
run_on_startup = true
name: Job identifier (string)at: Cron expression (format: second minute hour day month weekday)container: Target container name (string)command: Command to execute (array of strings)output_file: Optional output file path (string)run_on_startup: Execute immediately on startup (boolean, default: false)┌───────────── second (0-59)
│ ┌─────────── minute (0-59)
│ │ ┌───────── hour (0-23)
│ │ │ ┌─────── day (1-31)
│ │ │ │ ┌───── month (1-12)
│ │ │ │ │ ┌─── weekday (0-6, 0=Sunday)
│ │ │ │ │ │
* * * * * *
Examples:
0 0 2 * * * - Every day at 2:00 AM0 */15 * * * * - Every 15 minutes0 0 0 1 * * - First day of every month at midnightControl log level with RUST_LOG environment variable:
environment:
- RUST_LOG=info # info (default), debug, trace
MIT
Content type
Image
Digest
sha256:cdfb03e91…
Size
32.9 MB
Last updated
8 months ago
docker pull agjini/crooner