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

Setting BACKUP_CRON_EXPRESSION in env produces a parse error on latest version #185

Closed
eselskas opened this issue Jan 29, 2023 · 4 comments
Labels
support Support Requests

Comments

@eselskas
Copy link

  db-backup:
    image: offen/docker-volume-backup:v2.25.1
    restart: always
    environment:
      - BACKUP_CRON_EXPRESSION="*/5 * * * *"
    volumes:
      - db:/backup/db-backup:ro
      - /var/docker/db_backups:/archive

Starting the container produces:

# docker-compose up db-backup
Starting e_db-backup_1 ... done
Attaching to e_db-backup_1
db-backup_1  | Installing cron.d entry with expression "*/5 * * * *".
db-backup_1  | Starting cron in foreground.
db-backup_1  | crond: crond (busybox 1.35.0) started, log level 8
db-backup_1  | crond: user root: parse error at "*/5
db-backup_1  | crond: user root: parse error at *"

Downgraded to v2.0.0 and it works fine

Status: Downloaded newer image for offen/docker-volume-backup:v2.0.0
db-backup_1  | Installing cron.d entry with expression "*/5 * * * *".
db-backup_1  | Starting cron in foreground.
@m90
Copy link
Member

m90 commented Jan 29, 2023

I did not confirm this, but I think what you are seeing is just a change in log verbosity (introduced in #120) and not a change in cron expression parsing. Does v2.0.0 even run backups on the given schedule?

I'm no expert in cron expressions but a good start would probably checking the limitations of BusyBox's cron implementation and whether it allows the expression you are passing here.

@m90 m90 added the support Support Requests label Jan 29, 2023
@m90
Copy link
Member

m90 commented Jan 30, 2023

You need to unquote the expression string, something like this:

db-backup:
  image: offen/docker-volume-backup:v2.25.1
  restart: always
  environment:
    BACKUP_CRON_EXPRESSION: */5 * * * *
  volumes:
    - db:/backup/db-backup:ro
    - /var/docker/db_backups:/archive

to make sure you are not bitten by docker-compose passing the quoted string: docker/compose#2854

@m90
Copy link
Member

m90 commented Jan 30, 2023

Closing this, as it seems to be a duplicate of #117 - if this is not the case, feel free to reopen.

@m90 m90 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2023
@m90
Copy link
Member

m90 commented Feb 12, 2024

v2.37.0 brought a new cron scheduler so this might well be supported now

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

No branches or pull requests

2 participants