BackupPC-users

Re: [BackupPC-users] Remote mirror sanity checks

2010-02-26 21:40:43
Subject: Re: [BackupPC-users] Remote mirror sanity checks
From: dan <dandenson AT gmail DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Fri, 26 Feb 2010 19:38:51 -0700
if [ -e /var/lib/backuppc/testfile ];
   then rsync xxxx;
   else echo "uh oh!";
fi

should make sure that the filesystem is mounted.

you could also first do a try run
rsync -avnH --delete /source /destination > /tmp/list
then identify what will be deleted:
cat /tmp/list|grep deleting|sed 's/deleting /\//g'

now you have a list of everything that WOULD be deleted with the --delete option.  Run your normal sync and save this file for later

You could save take this file list and send it to the remote system

scp /tmp/list remotehost:/list-`date -%h%m%s`

on remote system

cat /list-* | xargs rm

to delete the file list.  You could do this weekly or monthly or whenever you needed.




On Fri, Feb 26, 2010 at 6:27 AM, Johannes H. Jensen <joh AT pseudoberries DOT com> wrote:
Hello,

We're currently syncing our local BackupPC pool to a remote server
using rsync -aH /var/lib/backuppc/ remote:/backup/backuppc/

This is executed inside a script which takes care of stopping BackupPC
while rsync is running as well as logging and e-mail notification. The
script nightly as a cronjob.

This works fairly well, except it won't remove old backups from the
remote server. Apart from using up unnecessary space, this has also
caused problems like hitting the remote filesystems hard link limit.

Now I'm aware of rsync's --delete option, but I find this very risky.
If for some reason the local backup server fails and
/var/lib/backuppc/ is somehow empty (disk fail etc), then --delete
would cause rsync to remove *all* of the mirrored files on the remote
server. This kind of ruins the whole point of having a remote
mirror...

So my question is then - how to make sure that the local backup pool
is sane and up-to-date without risking loosing the entire remote pool?

I have two ideas of which I'd love some input:

1. Perform some sanity check before running rsync to ensure that the
local backuppc directory is indeed healthy. How this sanity check
should be performed I'm unsure of. Maybe check for existence of some
file or examine the output of `BackupPC_serverMesg status info'?

2. Run another instance of BackupPC on the remote server, using the
same pc and hosts configuration as the local server but with
$Conf{BackupsDisable} = 2 in the global config. This instance should
then keep the remote pool clean (with BackupPC_trashClean and
BackupPC_nightly), or am I mistaken? Of course, this instance also has
to be stopped while rsyncing from the local server.

If someone could provide some more info on how this can be done
safely, it would be greatly appreciated!


Best regards,

Johannes H. Jensen

------------------------------------------------------------------------------
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/

------------------------------------------------------------------------------
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/