New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Looking for database backup script
Hello,
I am looking for a database backup script to backup my databases.
I want to backup all mysql databases into separate files and one other file which will have all databases and will be named all-databases.sql. They should all be compressed in one password protected archive.tar.gz which will have the date as the name.
I have looked into automysqlbackup but it doesn't meet my requirements. Is there another tool or script?
Thank you
Comments
Just found out this > https://gist.github.com/andsens/3736393
Then as for all DB into one file just use:
mysqldump --user=root --password=pass --all-databases > all_databases.sql
Then tweak all of this into one script and include your tar section
How do you restore with --all-databases? Thanks for sharing!
mysql -u root -p < all_databases.sql