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

Adding RESTORE_OPTS env parameter for restore #225

Open
scicco opened this issue May 12, 2023 · 4 comments
Open

Adding RESTORE_OPTS env parameter for restore #225

scicco opened this issue May 12, 2023 · 4 comments

Comments

@scicco
Copy link
Contributor

scicco commented May 12, 2023

Hello,

I'm currently using this image to backup an SSL-protected Mysql specifying an env file inside docker-compose.yml

The env file has several options like this:

...
MYSQLDUMP_OPTS="--ssl-cert /certs/client-cert.pem --ssl-key /certs/client-key.pem"
...

This is the docker-compose.yml relevant part:

...
  mysql_db_backup:
    image: databack/mysql-backup
    env_file: $HOME/myproject/mysql_db/env
    environment:
      - DB_DUMP_CRON="0 3 * * *"
    user: "0"
    restart: always
    volumes:
      - type: bind
        source: $HOME/myproject/mysql_db/backup
        target: /backup
      - $HOME/myproject/mysql_db/target.sh:/scripts.d/target.sh
      - $HOME/myproject/mysql_db/data/client-cert.pem:/certs/client-cert.pem:ro
      - $HOME/myproject/mysql_db/data/client-key.pem:/certs/client-key.pem:ro
    depends_on:
      mysql_db:
        condition: service_healthy
...

I'm using this image also for disaster recovery to perform a restore of the latest backup. Currently, there is no support for providing any option to the restore, so I'm not able to restore an SSL-protected database

Could you please consider adding RESTORE_OPTS env parameter, passing these options in the restore command invocation so that I can add this line inside my env file:

...
RESTORE_OPTS="--ssl-cert /certs/client-cert.pem --ssl-key /certs/client-key.pem"
...

and perform restore successfully?

Thank you in advance

@deitch
Copy link
Collaborator

deitch commented May 15, 2023

Sure, in favour of it. Open a Pull Request for it?

FYI, we are getting closer to a native golang version, which will include all of these options, along with the ability to run natively (outside of containers, as well as inside), and lots of other options.

@scicco
Copy link
Contributor Author

scicco commented May 16, 2023

Hello @deitch, thank you for your reply. I'll try it soon.

@deitch
Copy link
Collaborator

deitch commented May 16, 2023

it isn't in go yet, so do it with the current bash version. Just document it well.

@scicco
Copy link
Contributor Author

scicco commented May 26, 2023

Ok, I've managed to make it. Please check #228.

Thank you

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

No branches or pull requests

2 participants