quickshiftin / mysqlbkup Goto Github PK
View Code? Open in Web Editor NEWLightweight MySQL backup script in BASH
License: GNU Lesser General Public License v3.0
Lightweight MySQL backup script in BASH
License: GNU Lesser General Public License v3.0
I had a problem on mac using the "-r" flag on line 240
240-yours: dbs=$(echo $dbs | sed -r 's/(Database |information_schema |performance_schema )//g')
240-mine: dbs=$(echo $dbs | sed -e s/Database//g -e s/information_schema//g -e s/mysql//g)
Due to the current way the date format is being set, this script does not support hourly backups (for example) - it would be good if the date format is exposed within the config file. As far as I can see this should be sufficient to support multiple backups within a day.
One missing feature would be to be able to exclude certain db's, so that they are never backed up.
Line 205 should read
if [ -z "$HOST" ]; then
not
if [ ! -d "$HOST" ]; then
Because of the filename. I added
date=$(date +%F-%H_%M_%S)
instead of single %F, to be able running more backups a day (without overwriting the file everytime)
Would that be fine for you to change that?
As a suggestion, maybe mask the password - there really is no reason to see it.
First off, thanks for a great script!
FYI, on line 141 of mysqlbkup.sh, I think the operator should be '-ge' rather than '-gt'. Otherwise, it will only cull backups when the max is exceeded instead of maintaining the max (because we need to count the backup that is about to occur). Thanks again!
Is the database password visible with ps -ef (viewing the mysqldump command line)?
http://stackoverflow.com/questions/9293042/mysqldump-without-the-password-prompt
Is setting up a ~/.my.cnf for the user running the script the best way around this?
Brian
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.