Difference between revisions of "Rdiff-backup"

From Linuxintro
imported>ChrisM
imported>ChrisM
Line 13: Line 13:
  
 
== Usage ==
 
== Usage ==
 +
 +
=== Backing up ===
  
 
Making a backup is very easy:
 
Making a backup is very easy:
Line 20: Line 22:
 
  rdiff-backup /home/ user@backup-host:/var/backups/remote-home/
 
  rdiff-backup /home/ user@backup-host:/var/backups/remote-home/
  
If everythings works, [target] is madea an rdiff-backup location, which means, that the folder "rdiff-backup-data" should have been created there. From now on, you can use the above command to make a backup of the source, as often as you like.
+
If everythings works, [target] is made an rdiff-backup location, which means, that the folder "rdiff-backup-data" should have been created there. From now on, you can use the above command to make a backup of the source, as often as you like.
 +
 
 +
=== Inspecing ===
  
 
To see, what backups there were created at a given target, run
 
To see, what backups there were created at a given target, run
 
  rdiff-backup -l target
 
  rdiff-backup -l target
 +
 +
=== Recovering ===
  
 
With
 
With

Revision as of 18:56, 31 March 2009

Introduction

rdiff-backup is a tool written in Python to create incremental backups which allow you to go back to any point of time (where you made a backup) and extract files from then.

Since rdiff-backup actually makes reverse-incremental backups, the latest state (created the last time you ran rdiff-backup) is accessable in plain text, which means:

  • If you want the latest version, you can just throw away the "rdiff-backup-data" folder containg meta information.
  • Going back in time takes longer, the more far back you want to go.
  • Deleting old "snapshots" is a very fast operation, because it involves only deleting the oldest diffs but not rebasing any diffs to other plain text content.

Installation

rdiff-backup is available as a package for all major distributions, including Ubuntu, Debian, Gentoo, Fedora and (TODO!: probably, not checked because I have not access to any) OpenSuSE.

Usage

Backing up

Making a backup is very easy:

rdiff-backup source target

Both source and target can specify remote hosts (if doing so, the rsync algorithm is used to save bandwidth). For example, if I might want to save /home to a remote machine:

rdiff-backup /home/ user@backup-host:/var/backups/remote-home/

If everythings works, [target] is made an rdiff-backup location, which means, that the folder "rdiff-backup-data" should have been created there. From now on, you can use the above command to make a backup of the source, as often as you like.

Inspecing

To see, what backups there were created at a given target, run

rdiff-backup -l target

Recovering

With

rdiff-backup --restory-as-of [time] [target] # Short: rdiff-backup -r [time]

you can extract a backup from [target] whereas [time] denotes the date of the backup you want to extract. These time strings are very flexible, you can give * "now" for the latest backup

  • a time string in different formats, like YYYY-MM-DD, or even including hours, minutes or seconds
  • a relative timestamp like "1W" which means "one week ago" (allowed: (s)econds, (m)inutes, (h)ours, (D)ays, (W)eeks, (M)onths, (Y)ears)
  • seconds since Epoch.

Going further

There are a very lot of more options that can be used, to include or exclude files or directories having a certain pattern or attribute, getting statistics and changing verbosity or comparing different snapshots.

Just have a look at the man page:

man rdiff-backup