I need to stop and start MySQL database, take snapshots, and then restart My SQL database. Using Bash (RedHat Linux)
Check out the excellent script written by Tom Dau:
It specifically pertains to Oracle but the genesis of the operations is identical - Tom's script puts Oracle into and out Archive logmode in order to get the consistency but you should be easily able to substitute that for the MySQL equivalent or the shutdown/restart of the service.
Im sure you could do this with the PowerShell module... although I haven't had the chance to use it yet. If it facilitates snapshotting (which it looks like it does), you could simply use PowerShell to call plink.exe and pass your MySQL service stop, take the snap, start MySQL.
I'll be honest... I'm extremely new to the Nimble community and not aware of CLI/API capabilities yet. If you can ssh from Linux directly to Nimble then that would obviously be your choice.
Forgot to add... ping me offline at firstname.lastname@example.org if you need some help writing this. Both PowerShell and Bash.
I wrote my own snapshot utility similar to the oracle one. I already have custom backup scripts for mysql so I added this process to the same project. The basic idea goes like this:
* process on DB server locks database
* forked process starts snapshot on nimble
* after snap DB tables are unlocked
I posted the code here. Feel free to take a look.
JT Moree - you should post that to the main forum as well - there is a nice promotion running for the community for tips, suggestions and scripts...
Retrieving data ...