Librenix
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Rsnapshot: Archive, Snapshot, Backup MySQL Databases on Debian

Up
vote
Down

This howto will show you how to install and set up Rsnapshot, enable archiving of snapshots and how to back up MySQL databases on Debian. Rsnapshot is a filesystem snapshot utility for making backups of local and remote systems. Using rsync and hard links, it is possible to keep multiple, full backups instantly available. The disk space required is just a little more than the space of one full backup, plus incrementals. read more...
permapage | score:9194 | -falko, January 14, 2013

Scripting: A parallel Linux backup script

Up
vote
Down

This example bash shell script demonstrates a simple method of creating backups of multiple filesystems to multiple tape devices simultaneously. While the script presented writes to four tape drives in parallel, it can easily be modified to write to other device types and to create a different number of backup streams. The script is set up for the bash shell under Linux, but modifying it for another variety of Unix should simply be a matter of changing the locations of utility files such as tar, echo, cp, and sleep.

The script can be downloaded from http://librenix.com/scripts/par.tar.sh. Download the file now and load it into an editor as this article will refer to it frequently. Also, you may want to modify bits of it to match your filesystem names and your devices.

The first line of the script looks like this:
 #!/bin/bash
If the bash shell isn’t in the /bin directory on your system, you’ll need to modify this line. Enter the command which bash now to verify the location of bash. My Fedora Linux system and my Mac OS X system both have bash in /bin, but my FreeBSD system does not. If you have a non-Linux flavor of Unix, you’ll probably need to use the ‘which’ command to verify the locations of each command used in the script. The commands used are:
 bash
cd
sleep
echo
date
tar
wait
ls
wc
Note that ‘wait’ and ‘cd’ are usually implemented as internal shell commands and may not have external commands associated with them. If that is true for your system, leave ‘cd’ and ‘wait’ with no directory prefix just as they are in the original script.

Now, the first command in the script resets the current working directory to ‘/’:
 cd /
Since the script precedes each directory to be backed up with a ‘.’ to represent the current working directory, starting out at ‘/’ is necessary. The reason for this precaution is that some implementations of the tar command will only load files from a tar archive into the exact directory that was specified when the file was backed up. By prefixing the names with a ‘.’ we preserve the ability to recover the files into any subdirectory we want, without overwriting the original files.

Immediately after the ‘cd /’ command is where you would put any commands to shut down all services that must be quieted prior to a backup. The example script has a (commented out) command to initiate an Oracle database shutdown followed by a ‘sleep’ command to allow time for the shutdown to complete. The example database shutdown and the following delay probably don’t apply to your system. Obviously, you’ll have to add commands yourself to stop any applications that might interfere with the backup.

Next, we use the ‘date’ command to create two sets of four tiny files to stick at the start and end of each tape. Note that the presence of a ‘date.#’ file at the beginning of each tape lets you quickly find out when a tape was created and on which drive. The ‘zzzz.#’ files, appended to the end of each tape, only serve to let you easily verify that a backup completed without overrunning the end of the tape.

Next, we start the four actual ‘tar’ backup commands, each with sample directories named ‘./dir1’, ‘./dir2’, etc. Of course, you’ll need to modify the list of directories to match the actual directories you wish to back up. Note that you’ll probably want to balance the directory sizes so that all of the largest directores aren’t on the same tape. Also, note that each ‘tar’ command is run in the background and logs to a tar.#.log file in the /tmp directory. Obviously, you might want to put the logfiles somewhere else.

After each ‘tar’ command there is an entry like this: ‘TASK=$0’, or ‘TASK=$1’. These arbitrarily-named ‘TASK’ variables are used to store the process ID of each ‘tar’ command so that the script can wait for them with the four ‘wait’ commands that follow in the next block of code. There, we have the four ‘wait’ commands waiting on the $TASK0, etc, variables. (The addition of the ‘$’ to each TASK# shell variable is not a typo -- it’s necessary to read back the contents of the variable.)

Next, after the script has waited for the completion of each of the four ‘tar’ commands, it appends some information to a history file for later reference. It stores the date of the backup, the filesize of the logfile, and the number of files backed up on each tape to each of four history files. While the script will overwrite the logfiles (tar.#.log) each time it is run, it will append these three lines to each of the four history files (tar.#.history).

The final steps in the script are commented out. Those are the commands necessary to restart any applications that were brought down for the backup. Again, in the example we assume an Oracle database needs to be restarted. You’ll need to add the commands necessary to start any applications that were stopped at the beginning of the script.
mail this link | permapage | score:8903 | -Ray, April 10, 2005

BackupPC Installation And Configuration

Up
vote
Down

BackupPC is a high-performance, enterprise-grade system for backing up Linux and WinXX PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.
A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.
read more...
permapage | score:8694 | -gg234, June 19, 2006

Tutorial: Making Linux / UNIX snapshot backups

Up
vote
Down

I’d like to configure my Debian box to backup two remote servers using rsnapshot software. It should make incremental snapshots of local and remote filesystems for any number of machines on 2nd hard disk located at /disk1 ( /dev/sdb2). How do I make backups?

rsnapshot saves much more disk space than you might imagine. The amount of space required is roughly the size of one full backup, plus a copy of each additional file that is changed. rsnapshot makes extensive use of hard links, so if the file doesn’t change, the next snapshot is simply a hard link to the exact same file. read more...
mail this link | permapage | score:8381 | -nixcraft, February 12, 2008

Tutorial: Set up Postfix as a backup MX

Up
vote
Down

In this tutorial I will show how you can set up a Postfix mailserver as a backup mail exchanger for a domain so that it accepts mails for this domain in case the primary mail exchanger is down or unreachable, and passes the mails on to the primary MX once that one is up again. read more...
permapage | score:8376 | -falko, June 25, 2007

Tutorial: Create Encrypted FTP backups with duplicity, duply on Debian 6

Up
vote
Down

When you rent a dedicated server nowadays, almost all providers give you FTP backup space for your server on one of the provider's backup systems. This tutorial shows how you can use duplicity and duply to create encrypted backups on the provider's remote backup server over FTP. duply is a duplicity wrapper script that allows us to use duplicity without interaction (i.e., you do not have to type in any passwords). read more...
permapage | score:8368 | -falko, July 9, 2012

Tutorial: Backup LVM Partitions with Snapshots

Up
vote
Down

This tutorial shows how you can create backups of LVM partitions with an LVM feature called LVM snapshots. An LVM snapshot is an exact copy of an LVM partition that has all the data from the LVM volume from the time the snapshot was created. The big advantage of LVM snapshots is that you do not have to worry about open files and database connections, and you do not have to interrupt/halt services on the live partition because a snapshot is usually created in fractions of a second, so your users will not notice any disruption, and your snapshot holds consistent data. read more...
mail this link | permapage | score:8296 | -falko, April 18, 2007

Mondo Rescue: Free Linux backup and rescue

Up
vote
Down

You can also use Mondo to clone your current Linux system.
Mondo Rescue backs up your file system to CD, tape, NFS (archives stored remotely) or ISO's (archives stored locally). Mondo uses afio as the backup engine; afio is a well-respected replacement for tar. In the event of catastrophic data loss, you may restore some or all of your system, even if your hard drives are now blank. Mondo Rescue can do a lot of other cool things
read more...
permapage | score:8252 | -Ray, October 8, 2003 (Updated: October 24, 2004)

Back up MySQL Databases with mylvmbackup on Debian 6

Up
vote
Down

mylvmbackup is a Perl script for quickly creating MySQL backups. It uses LVM's snapshot feature to do so. To perform a backup, mylvmbackup obtains a read lock on all tables and flushes all server caches to disk, creates a snapshot of the volume containing the MySQL data directory, and unlocks the tables again. This article shows how to use it on a Debian Squeeze server. read more...
permapage | score:8148 | -falko, May 11, 2012

Bacula Network Backup Implementation Guide

Up
vote
Down

This is very detailed tutorial for implemeting bacula network backup in debian linux. This tutorial consists of four pages.

Bacula is a set of computer programs that permits you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds. Bacula can also run entirely upon a single computer, and can backup to various types of media, including tape and disk.

In technical terms, it is a network Client/Server based backup program. Bacula is relatively easy to use and efficient, while offering many advanced storage management features that make it easy to find and recover lost or damaged files. Due to its modular design, Bacula is scalable from small single computer systems to systems consisting of hundreds of computers located over a large network. read more...
mail this link | permapage | score:7931 | -gg234, June 7, 2006

Tutorial: Postfix backup mail server anti-spam setup

Up
vote
Down

According to RFC2821 the lowest-numbered records are the most preferred MX for domain. So a target Postfix backup server is used to keep the messages in a queue waiting for the primary server to become available. This ensures that if my primary MX goes down you do not loss any emails. However, spammers are connects to backup MX to avoid anti spam filters that are running on the primary MX server. This also hides their real IP from my primary MX. This tutorial shows how to configure anti-spam and anti-virus for Red Hat / CentOS Linux ver5.3 based Postfix mx server. read more...
mail this link | permapage | score:7876 | -nixcraft, May 5, 2009

Open source backup encryption

Up
vote
Down

Amanda or OpenSSL will encrypt your sensitive data...
There are a couple of good open source tools that will do encryption nicely. Probably the best one is OpenSSL, which supports a wide range of ciphers and is very easy to add into existing backup scripts. Quite simply, the command:
read more...
permapage | score:7828 | -Ray, March 1, 2007

Linux backup with dar and kdar

Up
vote
Down

Dar is a shell command that makes backup of a directory tree and files. Its features include splitting archives over several files, CDs, ZIPs, or floppies, compression, full or differential backups, strong encryption, proper saving and restoration of hard links and extended attributes, remote backup using pipes and external command (such as ssh), and rearrangement of the “slices” of an existing archive. It can now run commands between slices, encrypt archives, and quickly retrieve individual files from differential and full backups. Dar also has external GUI like kdar for Linux,thanks to the well documented API. read more...
mail this link | permapage | score:7789 | -gg234, January 13, 2007

Back up MySQL Databases with mylvmbackup on Ubuntu 12.10

Up
vote
Down

mylvmbackup is a Perl script for quickly creating MySQL backups. It uses LVM's snapshot feature to do so. To perform a backup, mylvmbackup obtains a read lock on all tables and flushes all server caches to disk, creates a snapshot of the volume containing the MySQL data directory, and unlocks the tables again. This article shows how to use it on an Ubuntu 12.10 server. read more...
permapage | score:7628 | -falko, January 17, 2013

JBackpack: Personal backup program

Up
vote
Down

JBackpack is a personal backup program. It features incremental backups, network transparency and encryption. JBackpack uses rdiff-backup for all backup and restore functions, SSHFS and SMB to access remote file systems and EncFS to encrypt backup destination directories.JBackpack uses rdiff-backup for all backup and restore functions. The most interesting feature of rdiff-backup is incremental backups. read more...
permapage | score:7597 | -gg234, April 23, 2012

Review: Arkeia Network Backup Software (free for Linux)

Up
vote
Down

This article mostly covers technical aspects of the product rather than the free license terms.
At first, basic configuration can be somewhat of a daunting task. Because Arkeia was clearly designed to be an enterprise solution, set aside ample time to organize your network's backup routine. It is in your best interest to be familiar with terms such as savepack, drivepack, and pool before beginning. The documentation is helpful here.
read more...
permapage | score:7593 | -Ray, August 18, 2000 (Updated: April 1, 2005)

Linux Backup: Simple Backup Suite

Up
vote
Down

Simplify your backup procedures with the Simple Backup Suite.
The simple-backup-config tool allows users to choose either a simple backup scheme that performs incremental backups daily and full backups weekly, or to modify the default scheme with their own settings. Users list directories to backup in the Include tab, and select items to exclude in the Exclude tab. Exclusions can be based on directory (e.g., /var/cache), file type (sbackup excludes multimedia files by default), file size (10MB is the default upper limit), or regular expression.
read more...
mail this link | permapage | score:7574 | -Ray, November 29, 2005

Verify Backups with cpverify

Up
vote
Down

Make sure your backups are what you think they are with this handy shell script.

Just add it to your backup job and mail any output back to you. Then, you'll know in advance when you have a bad backup.
cpverify verifies that a file or directory structure has been copied or burned without errors — that is, the copied file(s) is identical to the original. This is done by calculating a cryptographic checksum using the md5 message-digest algorithm on each file from the source and the copy destination. The checksums for each file are then compared. Any difference indicates that the copied file is not the same as the original source file.
read more...
mail this link | permapage | score:7571 | -Ray, August 8, 2005

mysqlhotcopy: Hot Backup of MySQL

Up
vote
Down

If you need to make live backups of your MySQL database, this is how you can do it.
If you want to make a hotcopy from your SQL database instead of a dump to a text file, you can use the mysqlhotcopy tool. This tool locks a table, copy it and than unlocks it again.

Use this command if you want to transfer the MySQL data to an other place on the same server...
read more...
permapage | score:7533 | -Ray, December 22, 2005

Create Ubuntu snapshot backups with FlyBack

Up
vote
Down

FlyBack is a tool similar to Apple's TimeMachine. It is intended to create snapshot-backups of selected directories or even your full hard drive. From the FlyBack project page: "FlyBack is a snapshot-based backup tool based on rsync. It creates successive backup directories mirroring the files you wish to backup, but hard-links unchanged files to the previous backup. This prevents wasting disk space while providing you with full access to all your files without any sort of recovery program. If your machine crashes, just move your external drive to your new machine and copy the latest backup using whatever file browser you normally use." This article shows how to install and use FlyBack on Ubuntu 7.10 (Gutsy Gibbon).

(here are some bright framed prints) read more...
mail this link | permapage | score:7529 | -falko, February 3, 2008 (Updated: April 26, 2012)
More articles...
Beautiful Abstract Art Prints

Recent headlines

Tahoe Least-Authority File System for secure, distributed data storage

Ubuntu Edge: Is there life after an unsuccessful crowd-funding campaign?

Dual-boot Windows 7 and Ubuntu 12.04 on a PC with UEFI board, SSD and HDD

Tutorial: Install Debian 7 (testing) with debootstrap from a Grml live Linux

LG 8-inch G Pad 8.3 Android tablet

LinSSID – Graphical wireless scanning for Linux

Hand of Thief trojan and your favorite Linux distribution

Does disk encryption really protect your data?

Usability, user-friendliness and the Linux desktop

4 third-party repositories for Fedora 19

Tutorial: Install SugarCRM CE on Fedora 10

Debian 6, Squid, Kerberos/LDAP authentication, Active Directory integration, Cyfin Reporter

How to install Ajenti on Ubuntu 13.04 server

vsftpd: Local, Virtual users with bash script maintainance

Tutorial: Debian 7 Samba Server with tdbsam

Tutorial: Automatically add a disclaimer to emails with alterMIME (Postfix on Debian 6)

How to replace Ufw with Firewalld in Linux Mint 15

Plasma Media Center 1.1 and digiKam 3.3

OpenShift Online: a non-developer guide

StartOS 6 GNOME 3 and KDE preview

Encrypt mail with SSL certificates

Linux Iptables Examples

Virtual Users/Domains with Postfix/Courier/MySQL/SquirrelMail (Debian 7)

Install Apache2, PHP5, MySQL on CentOS 5.7

Tutorial: Webcam streaming your desktop plus audio with ffmpeg, crtmpserver, Flowplayer

HowTo: HTTP Status: 206 Partial Content and Range Requests Using Curl

webOS: The latest Linux distribution

How to install postgresql 9.2 on Ubuntu 13.04 Server

Tutorial: Replace Windows with Pinguy OS 11.10

Python Client/Server Tutorial

Run Unity desktop on Linux Mint 12

Using Multiple PHP Versions (PHP-FPM FastCGI) With ISPConfig 3 (Ubuntu 12.04)

The Coming HTML 5 Revolution in Linux

Tutorial: Run Joomla 1.7 on Nginx on Debian 6, Ubuntu 11.10

PDNSD HowTo: A DNS Caching Personal Server

Tutorial: Install Postfix, Courier, MySQL, SquirrelMail on CentOS 6.2

Tutorial: USB-Over-IP server, Client on Ubuntu 10.04

Tutorial: Install Lighttpd, PHP5, MySQL on CentOS 6.0

Reviewing Kali Linux - the distro for security geeks

Tutorial: Fedora 19 Samba server with tdbsam

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin