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

issues with cron schedule #59

Open
stefangweichinger opened this issue Dec 18, 2024 · 2 comments
Open

issues with cron schedule #59

stefangweichinger opened this issue Dec 18, 2024 · 2 comments

Comments

@stefangweichinger
Copy link
Contributor

I am trying to establish a schedule running every 2 hours during the workweek:

  backup:
    image: bbtsoftwareag/mssql-backup:0.6.1
    depends_on:
      - sql.data
    environment:
      - TZ=UTC+1
      - DB_SERVER=sqlsrv
      - DB_USER=SA
      - DB_PASSWORD=sompwd
      - "DB_NAMES=
      intranet"
      - CRON_SCHEDULE=05 7-17/2 * * 1-5
    networks:
      - front

The container runs and the crontab seems OK in there, although there are no backups triggered.

If I use CRON_SCHEDULE=05 7-17 * * 1-5, it works (but runs every hour, sure)

So maybe the slash isn't interpreted correctly or something like that.

- CRON_SCHEDULE=05 7-17/2 * * 1-5

or

- CRON_SCHEDULE="05 7-17/2 * * 1-5" (quotes)

results in

root@0ceeaa17d526:/# crontab -l
05 7-17/2 * * 1-5 . /container_env.sh; /usr/local/bin/backup.sh > /proc/1/fd/1 2>&1 | tee -a

looks OK; but didn't work yesterday. I keep trying things, just reporting/asking here.

@stefangweichinger
Copy link
Contributor Author

this works:

- CRON_SCHEDULE=32 7-17 * * 1-5

@stefangweichinger
Copy link
Contributor Author

solved with

 - CRON_SCHEDULE=5 7,9,11,13,15,17 * * 1-5

So the notation with the slash is problematic, as far as I see.

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

No branches or pull requests

1 participant