Fast and efficient backups with rdiff-backup. Presented to the Fraser Valley Linux Users Group March 11, 2004 By Alan Bailward <alan@ufies.



Similar documents
Chapter 1. Backup service

Backup with rdiff-backup and rsnapshot

MySQL backups: strategy, tools, recovery scenarios. Akshay Suryawanshi Roman Vynar

Rsync: The Best Backup System Ever

Automated Offsite Backup with rdiff-backup

Backing up the Embedded Oracle database of a Red Hat Network Satellite

4PSA Total Backup User's Guide. for Plesk and newer versions

BACKUP YOUR SENSITIVE DATA WITH BACKUP- MANAGER

Linux Backups. Russell Adams Linux Backups p. 1

System Administration. Backups

Backup policies. Or - how not to get annoyed when you accidentally delete stuff. Warning - this does get a little technical

A Quick Start Guide to Backup Technologies

Rsync based backups. Rsync is essentially a directory syncing program.

BackupPC. Network Startup Resource Center

How To Backup A Database On A Microsoft Powerpoint 3.5 (Mysqldump) On A Pcode (Mysql) On Your Pcode On A Macbook Or Macbook (Powerpoint) On

Backing Up TestTrack Native Project Databases

Database Backup and Restore Mechanism. Presented by : Mary Meladath

File Systems Management and Examples

MySQL Backup and Security. Best practices on how to run MySQL on Linux in a secure way Lenz Grimmer <lenz@mysql.com>

Linux System Administration

Secure Shell Demon setup under Windows XP / Windows Server 2003

MySQL Backup IEDR

An Introduction to the Linux Command Shell For Beginners

Defeating Firewalls : Sneaking Into Office Computers From Home

INF-110. GPFS Installation

Linux System Administration on Red Hat

Zenoss Resource Manager ZenUp Installation and Administration

Determining your storage engine usage

Backing Up Your System With rsnapshot

Zenoss Core ZenUp Installation and Administration

Lenz Grimmer

SYSTEM BACKUP AND RESTORE (AlienVault USM 4.8+)

How To Run Linux On Windows 7 (For A Non-Privileged User) On A Windows 7 Computer (For Non-Patty) On Your Computer (Windows) On An Unix Computer (Unix) On Windows) On The Same

Data Integrity: Backups and RAID

ZFS Backup Platform. ZFS Backup Platform. Senior Systems Analyst TalkTalk Group. Robert Milkowski.

MySQL Backups: From strategy to Implementation

Volume SYNAMETRICS TECHNOLOGIES. A Division of IndusSoft Technologies, Inc. DeltaCopy User s Guide

Zenoss Core ZenUp Installation and Administration

SEAGATE BUSINESS NAS ACCESSING THE SHELL. February 1, 2014 by Jeroen Diel IT Nerdbox

RecoveryVault Express Client User Manual

Open-Xchange Server Backup Whitepaper

SendMIME Pro Installation & Users Guide

Online Backup Linux Client User Manual

Hervey Allen. Network Startup Resource Center. PacNOG 6: Nadi, Fiji. Security Overview

Online Backup Client User Manual

XtraBackup: Hot Backups and More

Web-Based Data Backup Solutions

Zenoss Core ZenUp Installation and Administration

Bacula The Network Backup Solution

A block based storage model for remote online backups in a trust no one environment

Bacula The Network Backup Solution

Open Source, Incremental Backup for Windows, Step By Step. Tom Scott BarCampLondon2, 17/2/07

Unix Sampler. PEOPLE whoami id who

How To Migrate To Redhat Enterprise Linux 4

Bacula The Network Backup Tool for *BSD, Linux, Mac, Unix and Windows

Online Backup Client User Manual

Backup Methods for your BBB or RPi2 Node

SSL Tunnels. Introduction

OpenGeo Suite for Linux Release 3.0

Migrating from Linux to Mac OS X. David Wheeler Kineticode, Inc.

Incremental Backup Script. Jason Healy, Director of Networks and Systems

The Nix project. Sander van der Burg. June 24, Delft University of Technology, EEMCS, Department of Software Technology

Jazz Source Control Best Practices

Configuring an OpenNMS Stand-by Server

HP-UX Essentials and Shell Programming Course Summary

Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 9.6)

CS 103 Lab Linux and Virtual Machines

MySQL backup and restore best practices. Roman Vynar September 21, 2015

Table of Contents. The RCS MINI HOWTO

Connectivity using ssh, rsync & vsftpd

Online Backup Client User Manual

Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5 Manage Backup and Recovery

Software Engineering Practices for Python

Centralized Disaster Recovery using RDS

1. Product Information

Online Backup Client User Manual Linux

Backup/Restore MySQL Server

Redmine Installation on Debian. v1.1

Step One: Installing Rsnapshot and Configuring SSH Keys

DFW Backup Software. Whitepaper DFW Backup Agent

COS 318: Operating Systems

Rancid Server Build and Operation Overview (v0.3) (This is being done from memory so expect some errors)

MySQL Backup and Recovery: Tools and Techniques. Presented by: René Senior Operational DBA

1. What is this? Why would I want it?

Of Penguins and Wildebeest. Anthony Rodgers VA7IRL

BackupAssist v5 vs. v6

Transcription:

Backing up in Style Fast and efficient backups with rdiff-backup Presented to the Fraser Valley Linux Users Group March 11, 2004 By Alan Bailward <alan@ufies.org>

Why Backup? Preserve data Save work and time Reinstalling is annoying Gives you a warm fuzzy feeling

No One Backs Up Backups occur immediately following a system crash -- unknown

Backing up is a pain to set up Many users and sysadmins just hope nothing happens to their system I know this first hand... but restoring is worse

It s Not the Backup... it s the restore Everyone can backup (in theory), but the restore is where people fall down.

Restoring Something that might never be needed Hard to test Scary to simulate

Backup Methods A hacked together shell or perl script involving tar and scp that grew from a one liner Commercial tool such as Arkira... Alternative Open Source solution

What s Needed? Scriptable Debuggable No more disk space used than needed Backup to any media/destination Incremental backups help here

Incra-what-al? Incremental backups are backing up only changed information Saves disk space bandwidth time But... harder to restore can t just copy files back

Enter rdiff-backup http://rdiff-backup.stanford.edu Backs up one directory to another, local or remote Open Source, compiles under POSIX Unix operating systems (and cygwin)

Technologies Written in python Mainly a combination of two technologies (r)diff rsync

What is (r)diff? Creates a patch file with only the changes from one version to another Diff used mostly for code (linux kernel) Less information needed to go from one version to another rdiff does binary diffs/patches

What is rsync? Mirrors files and attributes Local or remote Tunnel over ssh/rsh/sockets Very fast algorithm Sends only differences

Rsync Syntax rsync [OPTIONS] SRC DEST rsync [OPTIONS] SRC [USER@]HOST:DEST rsync [OPTIONS]] [USER@]HOST:SRC DEST And all combinations... For example rsync -avz --exclude *~ /home/ ajb@server:/backup/

Putting it Together rdiff-backup uses... rsync for fast mirroring rdiff for text/binary increments

Features Creates a mirror Keeps increments Preserves all information Space/bandwidth efficient Transparent data format

Usage Rdiff-backup Syntax rdiff-backup [OPTIONS] SRC DEST Example of local to local... rdiff-backup /foo /bar Local to remote... rdiff-backup /home ajb@host::/backups Remote to local... rdiff-backup ajb@host::/home /backups With more options... rdiff-backup --include /usr/local --exclude /usr / ajb@host::/backup

Increments 1 Normal incremental backup example Sunday - Full backup Monday - increment 1... Saturday - increment 6

Pain in the butt to restore if you crash on Saturday Hard to get to latest data

Increments 2 Rdiff-backup stores a mirror of current files older changes stored as reverse diffs via rdiff even binary files

Restoring with RD-B As easy as copying from the backup dir: cp /back/file /foo/file Or scp ajb@host:/back/file /foo/file Using rdiff-backups functions: rdiff-backup --restore-as-of now host.net::/ remote-dir/file local-dir/file Or by date: rdiff-backup -r 10D host.net::/ remote-dir/file local-dir/file

Other Functionality --list-increments --print-statistics --remove-older-than The Man page is your friend

Niggely Bits include/exclude syntax not totally intuitive Need dev series for --removeolder-than nb syntax.12.6 incompatible with.13.x Python, ick! :-P

My Script #!/bin/sh # remote host details REMOTE_HOST=arcterex.net BACKUPDIR=/var/backups/data PGBACKUP=$BACKUPDIR/pg.sql MYBACKUP=$BACKUPDIR/mysql.sql echo "Dumping fdisk output..." sfdisk -l > $BACKUPDIR/sfdisk-output.txt # dump the postgres database echo "Dumping Postgres database..." PGUSER=postgres PGPASSWORD=password su postgres -c \ "/usr/bin/ pg_dumpall -d > $PGBACKUP 2> /dev/null" # dump the mysql database echo "Dumping Mysqldatabase..." mysqldump -u root -ppassword --all-databases -c > $MYBACKUP # directories to backup MAININCLUDES="--include $BACKUPDIR \ --include /root \ --include /home/alan \ --include /var/www \ --include /etc \ --include /var/mail " #optional directories to backup with local not remote EXTRAINCLUDES=" --include /home/silverstr \ --include /home/raskal

# cont... echo Executing local rdiff-backup... rdiff-backup --print-statistics -v1 $MAININCLUDES $EXTRAINCLUDES --exclude / / \ /var/backups/ufies.org # catch the return code for error checking later RET1=$? echo Executing remote rdiff-backup... rdiff-backup --print-statistics -v1 $MAININCLUDES --exclude / / \ alan@${remote_host}::/mnt/share/var/backups/ufies.org # catch this return code too. 0 means ok, non-zero means not ok RET2=$? echo Removing old backups... # if everything went well then remove old backups if [ "$RET1" = 0 ] ; then echo "Local backup completed, removing older than 1 month" rdiff-backup --print-statistics -v1 --remove-older-than 1M --force \ /var/backups/ufies.org else echo "Bad return code for local backup" fi if [ "$RET2" = 0 ] ; then echo "Remote backup completed, removing older than 7 days" rdiff-backup --print-statistics -v1 --remove-older-than 7D --force \ alan@${remote_host}::/mnt/share/var/backups/ufies.org fi

Resources http://rdiff-backup.stanford.edu man rdiff-backup http://samba.anu.edu.au/rsync/

Questions?