Subject: Re: [Vserver] Vserver copy. The saga continues!
From: vserver@pineview.net
Date: Sun, 29 Jul 2007 08:49:42 +0930

Roderick A. Anderson wrote:
> The builds using rsync are going well but this has created a bit of a
> problem.  Typically I build using yum as the method.  This creates all
> the necessary files in /etc/vservers/<guest>/apps.  Using rsync doesn't.
>
> Is there a command/incantation to convert a vserver guest to another
> package-management system like yum, apt-get, etc?
>
> I suspect the pieces to do this are in the vserver script but if the
> method is just undocumented it would be quicker.
>
>
> TIA,
> Rod
Hi Rod

I have been using this script for years with out issue

#!/bin/bash
VS=$1
DST=$2

rsync --delete -e 'ssh -p 2222' -Pav --numeric-ids /vservers/$VS/*
--exclude=proc/* root@$DST:/vservers/$VS
ssh -p 2222 root@$DST "remountrw"
rsync --delete -e 'ssh -p 2222' -Pavl --numeric-ids /etc/vservers/$VS/* 
root@$DST:/etc/vservers/$VS
ssh -p 2222 root@$DST "remountro"
rsync --delete -e 'ssh -p 2222' -Pavl --numeric-ids
/var/run/vservers/$VS root@$DST:/var/run/vservers/$VS
ssh -p 2222 root@$DST "remountrw ; echo none >
/etc/vservers/$VS/apps/init/mark ; remountro"

This copy my vserver all over the place and they always work

Mike