/var/net/sys/admin/blog

INTRODUCTION

Data backup is the process of making copies of data in order to protect and restore original files whenever data loss happens. Aside from automated routine data backup, this method does not protect against failure and natural disasters. This is where off-site data backup comes in.

OBJECTIVE

To establish an off-site backup of important data such as website and configuration files, and database, by copying and burning it to a removable media via DVD.

Sample Scenario:

We need to backup the webserver files and database, and burn it on DVD disc.

PRE-BACKUP PROCEDURES:

mysql-zrm is short for Zmanda Recovery Manager for MySQL. It lets you create full logical or raw backups of your databases , generate reports about the backups, verify the integrity of the backups, and recover your databases. It can also send email notifcations about the backup status, and you can implement multiple backup policies.

This procedure was successfully tested and implemented on CentOS 5.X and RHEL 5.X servers.
Pre-requisites:
1.mysql client, MySQL server 4.1 and above
2.perl-DBI and perl-XML-Parser
yum install perl-DBI perl-XML-Parser

Installation:

1.Download mysql-zrm on http://www.zmanda.com/download-zrm.php
2.Get the RPM
wget http://www.zmanda.com/downloads/community/ZRM-MySQL/2.1.1/RPM/MySQL-zrm-2.1.1-1.noarch.rpm
3.Install
rpm -ivh MySQL-zrm-2.1.1-1.noarch.rpm

I had the chance to work as a systems administrator in an e-commerce company and they have Linux dedicated servers leased/purchase from a hosting provider.
Dedicated servers compared to a shared hosting is you have full control of the box. You can do whatever you want with the box, implement services and of course a full root access with the machine.

With this company, we are hosting about 200+ websites and some of them are hosted in our  boxes run in Redhat Enterprise Linux. As part of administering the box is to have a full and incremental backup of our dynamic website files and database. Scheduled shell scripts are set on this machine and luckily, I was able to find one of the useful backup solution script that can be found in this site:

Quick tip in backing up and restore your MySQL database:

Backing up and Restoring MySQL database

Backing up database:
Syntax:
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
o    [username] -database username
o    [password] -password for your database
o    [databasename] – the name of your database
o    [backupfile.sql] – the file to which the backup should be written.
Example:
mysqldump -u root -p asterisk > asteriskbackupmarch3.sql
(just input the password when prompt for password)

Multiple database:

Syntax:
mysqldump -u [username] -p [password] –databases  [databasename1] [databasename2] > [backupfile.sql]

Example:
mysqldump -u asteriskuser -p –databases asterisk asteriskcdrdb > multibackup.sql
(then input db password)

 

About FLT

This site is dedicated to everyone who likes to learn and explore the beautiful world of Linux. If you have comments and suggestions, please feel free to email at comments@freelinuxtutorials.com. I am happy to serve and share things esp. that is free and enjoyable as Linux.