MySQL Forums
Forum List  »  Backup

best way to backup data
Posted by: Alejandro Cavallo
Date: December 11, 2014 01:36PM

Hello everyone,
I was concerned about how to do a full database backup by using mysqldump as a part of a bash script.
Basically the idea is run mysqldump as following:
"mysqldump --no-create-db --add-drop-table --add-locks --allow-keywords --comments --create-options --debug-info --extended-insert --flush-logs --force --log-error=/backups/databases/dump_${DATE}.log --routines --set-charset --dump-date --triggers --tz-utc --single-transaction -u XXXX -pYYYYY -h localhost --databases ${DATABASES} > backup_${DATE}.sql"

After that check if mysqldump has returned an error or not:
if [ "$?" -eq 0 ]; then
echo "Success"
echo "error"
//alert admins about this situation, etc

If everything is OK, it will be compressed in a tarball file, then tested by using "tar -tzf <filename>". And if it is ok, the compressed file will be copied to an external server (by using Evault) which checks file integrity.

My question is, is that enough or should I restore the backup to another database and check if it is OK?
Does mysqldump fails if a table is having troubles?
What other things should I be aware of?


Options: ReplyQuote

Written By
best way to backup data
December 11, 2014 01:36PM
December 12, 2014 11:01PM
December 15, 2014 08:59AM
December 17, 2014 11:48AM
December 17, 2014 01:20PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.