Mysql hourly backup using cron

I wanted a cron job to run that would backup my Mysql database each hour. But I also wanted the command to create a new file each time preserving the history.

This is the command I came up with:

mysqldump --opt -u [username] [dbname] > /path/to/backups/database-`date +%Y-%m-%d-%k:%M:%S`.sql


Continue reading

Linux Mysql Client

Today I came across the Mysql Workbench GUI tool which for me is one of the most useful web development applications you can install on Linux.

The mysql website used to host a section called GUI Tools which gave you the awful Mysql Administrator and the incredibly buggy Mysql Browser. Both constantly crashed and were a nightmare.

Mysql Workbench seems to be a replacement of these 2 applications and handles SQL development, data modeling and server administration all under one app.


Continue reading

Mysql Remote Backup

This article covers how to write a Mysql backup script for shell. First of all we need to create the file so open a new text file called backup.sh and set the first line as.

#!/usr/bin/expect

We are using an expect script because it is better suited to dealing with remote requests and responses. The script is going to run like a command and will use the following parameters.


Continue reading