BackupPC-users

Re: [BackupPC-users] backup of backuppc and schedule, is it archive?

2010-03-11 12:08:35
Subject: Re: [BackupPC-users] backup of backuppc and schedule, is it archive?
From: Les Mikesell <lesmikesell AT gmail DOT com>
To: backuppc-users AT lists.sourceforge DOT net
Date: Thu, 11 Mar 2010 11:05:48 -0600
On 3/11/2010 10:38 AM, Sylvain Viart - Gmail wrote:

> Summary of this thread:
>
> Backing up some primaries backuppc servers, on a secondary backuppc.
> One of the primary hold itself 86 host.

Are you trying to back up the primary backuppc servers complete with 
history, or do you just need the latest full from each target in this copy?

> Strategy:
> Using a BackupPC_tarCreate loop on the primary, called from a
> DumpPreUserCmd on the secondary backup server.
> Then the secondary backup itself the copy of every extracted host.

This seems like you are adding a bottleneck compared to just backing up 
the targets directly from the primary and secondary backuppc servers.

> Gerald, noticed that it looks like archive mode, here's some pointers,
> and keywords:
>
> http://backuppc.sourceforge.net/faq/BackupPC.html#archive_functions
> $Conf{XferMethod}  = 'archive';
> $Conf{ArchiveDest} = '/tmp';
> BackupPC_archiveHost
>
> On 11/03/2010 15:03, Gerald Brandt wrote:
>> You can specify where the archive is saved when you create an archive
>> host, and again when you start an archive process
>
> yep, the archive mode seems, not very well documented.

The archive mode is really just a wrapper around BackuPC_tarCreate to 
give it a web interface.  If you are using your own scripts you might as 
well run the commands directly there so you have complete control.

> this gives me:
>
> primary backup server:
>
> cat /etc/backuppc/archive-for-secondary.pl
> $Conf{XferMethod}  = 'archive';
> $Conf{ArchiveDest} = '/tmp';
>
> # an archive requested from the web
> /tmp/host-01.96.tar.gz
>
> Can I mount a ssh folder between the secondary and the primary for that
> purpose?..
> So I could, change:
>
> $Conf{ArchiveDest} = '/mnt/secondary_archive';
> I still need to extract them on the secondary before the backup.

Sure, but it is probably more efficient to pipe to a remote cat or dd to 
write a stream to a remote file.

> Here is some part of my loop, which doesn't use archive mode, run on the
> primary:
>
> function extract_server()
> {
>       host=$1
>       fullhost=$(awk "/^$host/ {print \$1}" $conf)
>       if [ -z "$fullhost" ]
>       then
>           echo "fullhost not found for $host, skipped"
>           return
>       fi
>
>       echo "host=$host, fullhost=$fullhost"
>
>       # as we tar extract, the folder should be removed before overwriting
>       # done on the secondary_backup by remote_pre_cmd
>       destdir=$destmachine_dir/$host
>       remote_pre_cmd="/etc/backuppc/remote_backup_cleanup.sh $host"
>       su - backuppc -c \
>       "time /usr/share/backuppc/bin/BackupPC_tarCreate -h $fullhost -n -1
> -s / / |
>       ssh -l root $secondary_backup '$remote_pre_cmd&&  mkdir -p $destdir
> &&  cd $destdir&&  tar -x'"
> }
>
> # extract every hosts
> for host in $host_list
> do
>       # if I could do diff rsync would be better
>       extract_server $host
> done

If you hit the hosts directly you could use rsync.  Maybe you could use 
the same ssh identity key and just script the config updates to 
propagate changes as you add hosts to the primaries.

-- 
   Les Mikesell
    lesmikesell AT gmail DOT com

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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/