rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] Magic increments via LVM snapshots idea


From: Steven Willoughby
Subject: Re: [rdiff-backup-users] Magic increments via LVM snapshots idea
Date: Tue, 24 Apr 2007 12:14:08 -0600
User-agent: Thunderbird 1.5.0.10 (X11/20070403)

Joshua N Pritikin wrote:
On Mon, Apr 23, 2007 at 05:19:32PM -0600, Steven Willoughby wrote:
I think it is possible to combine rdiff-backup and LVM snapshots to have incremental backups on the same machine without having two full copies of the data set.

It's not even very tricky to set up:

#!/bin/sh

#set -x
set -e

echo "rdiff-backup"

host=leghorn
snapname=/dev/r1vg/homesnap

remove_snapshot() {
  umount $snapname || echo 'unmounted already'
  if lvs $snapname > /dev/null 2>&1 ; then
    lvremove -f $snapname
  fi
}

if  ping -q -c 3 $host > /dev/null; then
  remove_snapshot
  lvcreate -L 2G --snapshot --name homesnap /dev/r1vg/home
  mount $snapname /mnt/home_ro
  ssh $host mount -t ext3 /dev/b1/rdbackup /mnt/rdbackup || echo  'already 
mounted'
  rdiff-backup --print-statistics /mnt/home_ro $host::/mnt/rdbackup/home
  rdiff-backup --force --remove-older-than 1M $host::/mnt/rdbackup/home
  ssh $host umount /mnt/rdbackup
  remove_snapshot
else
  echo "Can't backup to $host; unreachable"
fi



This isn't really what I mean. Your script uses snapshots to provide a non-changing source from which to make the backup. I was thinking of using two snapshots at once to be able to create an incremental history of changes on the same machine without having two copies of the data.

Steven




reply via email to

[Prev in Thread] Current Thread [Next in Thread]