fradelg / docker-mysql-cron-backup

Docker image to backup all your databases periodically
Apache License 2.0
305 stars 111 forks source link

Restore one DB from list #66

Closed ay1man4 closed 2 years ago

ay1man4 commented 2 years ago

Hi,

In current configuration for auto restore during intial docker startup, restore script will restore all databases configured in environment variable _MYSQLDATABASE which is defaulted to --all-databases If we set _INIT_RESTORELATEST, during startup it will check _MYSQLDATABASE and restore all databases set on it. The problem is if we want to restore one database only, if change _MYSQLDATABASE, this will impact the backup.

I suggest to add another environment variable for restore databases for example MYSQL_DATABASE_RESTORE, so backup will not be impacted and user will have control to restore any database just by changing the value of _MYSQL_DATABASERESTORE and set the flag _INIT_RESTORELATEST.

fradelg commented 2 years ago

I get what you mean. I will think about it but you can always run the container with the restore.sh as command to restore your specific DB and then backup the others. Please, check the documentation:

https://github.com/fradelg/docker-mysql-cron-backup#restore-using-a-compose-file