Open Doctorf opened 2 months ago
It is rather simple and elegant. I would be happy to add it. I have a few questions:
DB_DUMP_TARGET
? You could set a target that way, but it is not necessarily set that way. Of course, we could add it, set for each target, which is a pretty good way to pass it.Also, have you looked at the Custom backup file name option?
Hi @deitch
1) I'm using next image in docker image: databack/mysql-backup:latest
and it's related to https://hub.docker.com/layers/databack/mysql-backup/latest/images/sha256-fb35135e01f1746ea46dbabb6ee2f85cc1f0b42cb3c79c8718e8d87288bf288d?context=explore
I'm trying to use master, but I have a problem with post scripts. Now all changes moved to target.sh
script and can be working on master. But I don't test it.
2) Thanks for clarification. Yes, In my version, I need to set up only one dump target and it's local mounted directory. Script can be working with it. But it's possible to check variable or split variable for multiple targets.
3) This env variable not described in docker hub page and I see, that variable not working in mysql-backup:latest
image. I will try to use, but new directory not created, Maybe need time for recheck.
but I have a problem with post scripts
Yes, I know. That fix just went through a few hours ago. Try the most recent, either pull master
again or tag d6dc847c1df98a32936ff29b2007fcfa8640fb4f
.
that variable not working
Yes, that probably is it. I will get a fix in the next day or so.
Did you try the custom backup filename option?
The more I think about it, the less I understand how to use the example.
There are two renaming options: source and target. The process is:
Source renaming lets you change the name of the temporary file, i.e. the output from the actual dump. That file is temporary, and has no meaning beyond the current dump. The name - default or what you change it to - will be ignored. The only real value it has is if you want to append some data to the file, encrypt it, change it somehow. From mysqlbackup's perspective, it doesn't know or care. It just sees those 2 stages - dump and upload - and lets you change the value of it in the middle.
Target doesn't do anything, ignores any local activity. The only thing it does is change what the remote name would be. So if it was "foo.tgz" by default and you want it to be "bar.tgz", mysqlbackup says, "ok, sure, I will call it that name when I push it in stage 2."
I am not convinced a script is necessary for it, but even if it is, how does knowing the target help? More to the point, making directories and such will not do anything.
Hi team. Here is a simple script for moving target backup to a new directory by year and month:
File
/scripts.d/target.sh
:Could you please check this script and add to repo as sample and to docker hub page? It's a simple solution, but I can't find this example. Maybe it will be helpful.