So far we covered backing up Olivia, restoring our data and workday environment, and setting up our LAMP stack with Apache, MySQL and PHP. Today in our Olivia to Petra Bash series we'll look at the bash script used to restore our MySQL databases.
We installed MariaDB 10 in our LAMP Stack Installation script, so all that remains is restoring our databases and perhaps creating some MySQL user accounts. Our databases sitting on a Cloud drive displayed below. The MySQL databases have a .sql filename extension.
Here's our script logic.
I mentioned an echo statement in #3 where we can display the archive file elements while testing the script. Below is the output of the script with the echo statement enabled and bypassing the restore_db() function.
Here's a link to the script tar.gz. You know by this point in the party that I am in no way responsible for any [bad] consequences from using the script. Good luck!
We'll be winding up our Olivia to Petra Bash in the next post with a script that re-creates our Apache Web Sites!