BackupPC-users

Re: [BackupPC-users] Two external disks change: best practice and scripts

2008-12-16 08:39:35
Subject: Re: [BackupPC-users] Two external disks change: best practice and scripts
From: Les Stott <les AT cyberpro.com DOT au>
To: BackupPC Users <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 17 Dec 2008 00:19:57 +1100
Ermanno Novali wrote:
> Hi everyone,
> i'd like to try out this way to backup with backuppc on a linux server
> http://sourceforge.net/mailarchive/message.php?msg_id=20070225105524.GE3265%40tux1.brauer.lan
>
> with 2 usb/firewire external disks on the same server to swap on
> daily/weekly basis,
> on every disk backuppc will backup the whole pool normally /his
> /var/lib/backuppc pool for example) and with this scenario
> i'll have the complete backup on every disk (1 one day/week older than
> the other, not an issue)
>
> I assume that backuppc will have to stop before disk unmount, and also
> that backuppc will restart
> only if the other disk is mounted correctly.
> I'd like to know if anyone have used some scripts to do this,
> especially if there is a way to integrate
> the scripts with backuppc or if i have to use udev/linux tools to
> check the disks and then start backuppc, and if it's a good way
> (i think so from the previous post i linked)
>
>
>   
This is definitely possible.

I have it working with a rotation weekly, but you could rotate it daily 
just as easily. It may not be the most elegant way, but it works ;)

It's late, here's the summarized process.....

I always install from source tarballs which allows me to choose where to 
store data, i prefer /mnt/usbdisk/BackupPC rather than prebuilt packages 
with /var/lib/backuppc, but it makes no difference, just different mount 
points.

Format your usb drives, one at a time.

Mount one disk where you want to mount it (i.e. /mnt/usbdisk)

ensure that the backuppc user can write to the drive.

chmod 775 /mnt/usbdisk (after it is mounted).
chgrp backuppc /mnt/usbdisk

Now install BackupPC and tell the data directory to be 
/mnt/usbdisk/BackupPC (or whatever you like to call it).

I then use a modified init script which mounts the drive before starting 
backuppc and unmounts the drive after stopping backuppc. If it has any 
problems mounting it sends me an email.

I use cron to start and stop backuppc at specific times. Usually 
something like.....

# BackupPC on usb disk
5 22 * * * /sbin/service backuppc start
5 7 * * * /sbin/service backuppc stop

This means end users can simply unplug and swap the drives in the time 
window between the two cron jobs. Backups usually kick in at 11pm.

For the second disk you will need to mount and set permissions for the 
backuppc user. Then you'll need to manually create the TopDir 
(/mnt/usbdisk/BackupPC) and the following subdirectories....

/mnt/usbdisk/BackupPC/pc
/mnt/usbdisk/BackupPC/cpool
/mnt/usbdisk/BackupPC/pool
/mnt/usbdisk/BackupPC/trash

be sure you set the permissions and ownership correctly. Check the first 
disk setup after it has run a backup.

Then just proceed to swap them in and out. BackupPC handles this with 
ease, it just picks up where the last drive left off.

If you like i can post the changed init script (redhat/centos based).

Hope that helps.

Regards,

Les





------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/