Backing up my MySql data

Please excuse this rather uninteresting blog post, I just wanted somewhere to store a copy of this bash script which backs up my MySql data.

#!/bin/bash
# *=================================================================*
# * Filename : backupsql.sh *
# * Purpose : To backup all MySQL data to file 'backup.sql' *
# * Author : James McCann *
# * Last updated on : Monday 13th December 2014 *
# * Last updated at : 22:45 *
# *=================================================================*

clear
echo "===================================================================================================="
echo " M y S Q L d u m p "
echo "===================================================================================================="
ls -l -ltr *.sql
echo ""
echo "Below, enter the MySQL root password."
mysqldump -u root -p --events --ignore-table=mysql.event --all-databases > backup.sql
echo ""
ls -l -ltr *.sql
echo ""
echo "===================================================================================================="
toilet "* * * F I N I S H E D * * *" --gay --termwidth
echo "===================================================================================================="
echo ""

Please try not to be too distressed by the “toilet” line, it simply prints text using large characters made of smaller, pretty characters, as in this example.

Advertisements

About Words of Little Relevance

Freelance stage manager; software and web tester; Excel and map geek; Tweeter; Blogger and Cake Eater. Often back-stage in and around Oxfordshire and Buckinghamshire where I move scenes, or play with lights or sound.
Quote | This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

One Response to Backing up my MySql data

  1. Bo says:

    Why not try gist ?
    Bo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s