Open bansalvinay opened 1 year ago
I recommend running it with DB_DUMP_DEBUG=true
and then putting output here (please scrub sensitive data first). However, I strongly suspect it is because DB_NAMES
is a global var and is set here, and so it is preset the next loop. It should be a simple fix. Care to open a PR for it?
That's right, the problem is relative to the global var DB_NAMES
which is not reset if already set previously. This also causes an error in the execution if the DB_DUMP_BY_SCHEMA
flag is set and one or more databases are deleted after the first run of the script, because it continue to backup a schema that previously removed .
I think the simple way to do that fix is to remove the control between these line here, in that way the script reload the list every time is running .
Maybe one day i can make highlight line selection more precise when github decide to implement this feature 😆
If you want, I can do the PR.
I think the simple way to do that fix is to remove the control between these line here, in that way the script reload the list every time is running
Well, almost. If the user explicitly passed DB_NAMES
, then it restricts it to those, so it will require a little reworking to capture command-line-passed and only check each time if that was not passed.
I would appreciate the PR, indeed.
I'm using Ubuntu Mysql image. The backup runs fine for the databases which are created before this container is started. It runs for these databases continuously on cron as expected. But when there are new databases created, these are not backed up until this container is restarted.
Here's my composer code for mysql-backup :