Archive for the tag 'backup'

rsync to backup your home directory and mysql databases.

Run the below rsync command using “nohup”, nohup runs a command immune to hangups, with output to a non-tty.

Rsync your home directory’s to your backup server.

Replace $IP with the IP address for your production server.

Run the below commands from your backup server.

#rsync -vrplogDtH –exclude=virtfs/ –progress -e ssh root@$IP:/home/ /home/

rsync all mysql databases.

#rsync -vrplogDtH –progress -e ssh root@$IP:/var/lib/mysql/ /var/lib/mysql/

Backup DB server_support

rsync -vrplogDtH –progress -e ssh root@$IP:/var/lib/mysql/server_support /var/lib/mysql/
SBDavid

rsnapshot filesystem backup utility

rsnapshot is a filesystem backup utility based on rsync.

Using rsnapshot, it is possible to take snapshots of your filesystems at different points in time. Using hard links, rsnapshot creates the illusion of multiple full backups, while only taking up the space of one full backup plus differences. When coupled with ssh, it is possible to take snapshots of remote filesystems as well.

rsnapshot is written in Perl, and depends on rsync. OpenSSH, GNU cp, GNU du, and the BSD logger program are also recommended, but not required.

All of these should be present on most Linux systems.

By default, the installation procedure will install all files under /usr/local. If you’ve followed these instructions so far, you will have configured rsnapshot to be installed under /usr/local, with the config file in /etc.

Under these circumstances, it will be necessary to become root to install the program. Now is the time to do so. You will, of course, need the root password to do this:

su

This will prompt you for the root password.

Now, to install rsnapshot, run the following command:

make install

This will install rsnapshot with all the settings you specified in the ./configure stage. If all goes well, you will have the following files on your system:

/usr/local/bin/rsnapshot The rsnapshot program
/usr/local/man/man1/rsnapshot.1 Man page
/etc/rsnapshot.conf.default The example config file

The latest version of the program and this document can always be found at http://www.rsnapshot.org/.

SBDavid

Restoring a backup in Webmin

Restoring a backup in Webmin

If you find that a config file on your system has been corrupted, incorrectly edited or mistakenly deleted, it can be easily restored using this module.

The steps to perform a restore are :

Click on the Restore now tab.

Select the module or modules whose config files you want to restore from the Modules to restore menu.
In the Restore from section, enter the path to a local or remote file that was originally created by this module.

To be useful, it must contain backups for the modules that you selected above.

Click the Restore Now button.

If all goes well, a page will be displayed showing the number of modules and files restored.

Files will be restored to their original locations on the system, rather than the paths that are set on the Module Config pages of the selected modules.

Creating a scheduled backup in Webmin

Once you have performed a manual backup, you can schedule it to run on a regular basis as follows :

Click on the Scheduled backups tab.

Click the Add a new scheduled backup link, which will open the form shown below.

Select the modules whose config files you want to include from the Modules to backup list.

Enter a local or remote file destination in the Backup destination section.

If you want to be notified about the status of this backup, enter your email address in the Email result to address field.

In the Scheduled backup enabled? field select Yes, and choose the times and days for the backup to run from the Cron time selector below it.

Click the Create button.

Once a scheduled backup has been created, you can edit or remove it by clicking on the destination path in the table under the Scheduled backups tab.

How to Backup MBR - Master Boot Record

The MBR (master boot record) is located at cylinder 0, head 0, sector 1. It’s the very first sector of the hard drive and it is 512 bytes in size. When the BIOS boots your machine it looks in the MBR for information on your partitions and the initial boot loader. The MBR contains a partition table and boot code. The boot code executes and then transfers the process to the bootloader program on your active(bootable) partition.

We can take the backup of MBR either to a floppy disk or to a CDROM.

1. Backup to a floppy:

dd if=/dev/hda of=/dev/fd0 bs=512 count=1

2. Backup to CDR:

First, create the MBR backup to a file on your hard drive.

dd if=/dev/hda of=mbr.bak bs=512 count=1

Now, burn the file you just created to CDR.

« Prev - Next »