[Box Backup] Run several config-files as one Client

James O'Gorman boxbackup@fluffy.co.uk
Tue, 19 Feb 2008 19:46:06 +0000


Hi Ben,

On Tue, Feb 19, 2008 at 05:06:45PM +0100, Benedikt Niessen wrote:
>  Hi,
> 
>  I have several jails/virtual servers running on one machine.
> 
>  I want to configure BoxBackup to stop the first jail, make a backup, start 
>  the server again, then stop the next one etc.
> 
>  I was thinking to make a shell-script which calls the bbackupctl-command 
>  with a different config-file each but as the same client-id (which belongs 
>  to the whole machine). Here I could include the different folders for each 
>  jail/virtual server.
> 
>  Is that possible or how would you realize this?

Assuming you mean FreeBSD's jails, and are running a fairly recent
release, you could probably do something like this:

#!/bin/sh

# Suck in the rc.conf settings
. /etc/defaults/rc.conf
source_rc_confs

# Loop through $jail list, stop each jail, run a sync and start it again
for jail in $jail_list; do
	/etc/rc.d/jail stop $jail
	bbackupctl -c /usr/local/etc/box/bbackupd_$jail.conf sync
	/etc/rc.d/jail start $jail
done

NB: This is totally untested, but should give you the basic idea :-)

Not quite sure why you want to stop the jail though - can't you just
have a single bbackupd.conf with a location for each jail and have it
backup automatically as usual?

James