we’ll show you, how to install AutoMySQLBackup on a Linux VPS. AutoMySQLBackup is very useful utility for creating daily, weekly or monthly backups of one or more MySQL databases from one of more MySQL servers. It dumps the databases and compress them in to archives.it comes with many features such as:
- Email notification of backups
- Backup Compression and Encryption
- Configurable backup rotation
- Incremental database backups
1. Login via SSH
As usual, log in to your server as user root
2. Update the System
and execute the following command to make sure that all services ar up to date
For Debian based systems execute
apt-get update && apt-get upgrade
For RPM based systems execute
yum -y update
3. On Debian based distributions AutoMySQLBackup is available in the repositories
If you are running Debian based distro AutoMySQLBackup is available in the repositories and you can easily install it by executing the following
apt-get install automysqlbackup
4. On RPM based distributions you will have to download AutoMySQLBackup
If you have a RPM based distro you will have to download AutoMySQLBackup’s installation scripts, run and configure them on your server. In this tutorial we will install Automysqlbackup on a CentOS 7 VPS.
5. Download AutoMySQLBackup
Download the latest version of AutoMySQLBackup to your server
6. Install AutoMySQLBackup
Create a directory for Automysqlbackup’s scripts and unpack the downloaded tar archive
mkdir /opt/automysqlbackup tar zxvf automysqlbackup-v3.0_rc6.tar.gz -C /opt/automysqlbackup
Once the archive is unpacked run the Automysqlbackup installation script
cd /opt/automysqlbackup ./install.sh ### Checking archive files for existence, readability and integrity. automysqlbackup ... exists and is readable ... md5sum okay :) automysqlbackup.conf ... exists and is readable ... md5sum okay :) README ... exists and is readable ... md5sum okay :) LICENSE ... exists and is readable ... md5sum okay :) Select the global configuration directory [/etc/automysqlbackup]: Select directory for the executable [/usr/local/bin]: ### Creating global configuration directory /etc/automysqlbackup: success
You can use the default paths for the global configuration directory and the directory for the executable. You just have to press Enter when the paths are required.
7. Configure AutoMySQLBackup
Next, we have to configure AutoMySQLBackup. Open its configuration file located in the directory we set when we ran the installation script.
And uncommend and set the following confituration directives
CONFIG_mysql_dump_username='root' CONFIG_mysql_dump_password='YourPassword' CONFIG_mysql_dump_host='localhost' CONFIG_backup_dir='/var/backup/db' CONFIG_do_monthly="01" CONFIG_do_weekly="5" CONFIG_rotation_daily=6 CONFIG_rotation_weekly=35 CONFIG_rotation_monthly=150 CONFIG_mysql_dump_port=3306 CONFIG_mysql_dump_compression='gzip'
Once you are done with editing, save the configuration file. All settings are optional and there is description for all of them, so it is best to check the configuration file for more information about the settings of AutoMySQLBackup.
Create a directory for the MySQL backups. This is the directory we set as ‘backup_dir’ in the configuration file.
If you want to create a backup of your MySQL databases, run AutoMySQLBackup by executing the following
You can also create a crontab entry to run AutoMySQLBackup at a specific time.
That’s all. You can check the README file for more information on how to use AutoMySQLBackup.
Of course you don’t have to install and configure AutoMySQLBackup, if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install AutoMySQLBackup for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post, on how to install and configure AutoMySQLBackup, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.