Craig Barratt wrote:
Toni writes:
PS: maybe this can be FAQ'ed?
Please write it up (perl POD - basically plain text) and
I will put it in the FAQ.
You ask, I create.
Attached is my FAQ entry. Please everybody: read it and propose
improvements. Also, can somebody fill in Example 3? I will fill in
Example 2 if I have set it up successfully here.
Regards,
--
Toni Van Remortel
[EMAIL PROTECTED]
=head1 Importing data in backups
If you want to import a backup snapshot into BackupPC before starting any
backups.
=head2 Prequisites
Before you can start with the import, make sure you ...
=over 4
=item *
... have the data at hand you want to import. Storage on USB disks, NFS shares
or even SMB shares on a local network are some examples. The most important is
that you can simulate your target client that you want to backup. So if your
client is a Windows server, you should create a simulated Windows server with
the correct shares (Samba is very good at it). If you have a client that is
backed up through SSH, you need to set up a simulated server with SSH (this can
be, and is advised to be, the backup server itself). More detailed examles
below.
=item *
... have enough privileges on the simulation server to perform configuration
tasks.
=back
=head2 Examle 1 : simulating with SSH and rsync, and backing up non default
paths
This example is quite easy. Here we will import backups that are located on the
client in /mnt/samba/data.
The data to import is stored on a USB disk which we mount on /mnt/usbdisk.
=over 4
=item Step 1: edit /etc/hosts
We will use the backup server as simulation host, because that will give us the
best performance.
To start, we add an entry in the servers /etc/hosts
127.0.2.1 simulation_host
I use an address that is bound to 'lo', so you have a simple check on the
import speed (just watch 'lo' with eg 'bmon').
=item Step 2: set up passwordless SSH login
In normal situations, the backuppc user has no home directory. It is advised to
create one, because that will hold the users pre-shared ssh keys. To keep it
secure, we will only allow the backuppc user to use them.
usermod -d /home/backuppc backuppc
Become the backuppc user:
su - backuppc
And create a SSH key to use for our simulation host:
mkdir .ssh
cd .ssh
ssh-keygen -t rsa -f simulation_host
When ssh-keygen requests a password or passphrase, just hit enter.
Next, copy the ssh-key:
ssh-copyid -f simulation_host.pub [EMAIL PROTECTED]
You can see we copy the key to [EMAIL PROTECTED] This will thus allow the
backuppc user to log in as root to our simulation_host.
To tell ssh which key to use, create a /home/backuppc/.ssh/config file with
this in it:
Host simulation_host
User root
IdentityFile /home/backuppc/.ssh/simulation_host
CheckHostIP no
Try to log in now (run this as the backuppc user):
ssh [EMAIL PROTECTED]
You will get the question if you trust this host. Answer 'yes' and you should
get the root prompt. If you log out from the root promt, and try the ssh login
again, you should get a root prompt without any further interaction.
=item Step 3: Set up the share
So now we have a passwordless login to our simulation_host, as we should have
to our normal client (if you don't have that, follow the instructions in Step
2, replacing simulation_host with a FQDN from your client).
On the client, we like to backup /mnt/samba/data. So we will set that up on our
simulation_host.
mkdir -p /mnt/samba
ln -s /mnt/usbdisk/client001/samba/data /mnt/samba/data
The data we want to import is located on our USB disk below some subdirectories
(client001/samba/data). So we symlink the 'data' directory to /mnt/samba/data,
as that is the directory that is used on the real client.
=item Step 4: configuration of the client in BackupPC
Configure the client in BackupPC. Fill in every configuration detail like you
would use it for the rest of the backup servers life. Make sure you use the
clients FQDN as 'host' name.
Set the XferMethod to rsync, and fill in the correct share name:
/mnt/samba/data
As last option, fill in the ClientNameAlias:
simulation_host
BackupPC will use the ClientNameAlias instead of the host name when it is used.
That's really nice, as this allows us to simulate the backup.
=item Step 5: run a full backup
Open up the clients home page in BackupPC, and hit the Start Full Backup
button. BackupPC will now start a full backup over SSH to simulation_host and
backup every file under /mnt/samba/data.
You can monitor the progress by watching the LOG file, and in a console on the
backup server with eg bmon (bandwidth monitor) on the 'lo' interface.
=back
=head2 Examle 2 : simulating with SSH and rsync, and backing up system paths
This is slightly more difficult, as you should set up a chrooted SSH
environment.
Key components are using another user as root (otherwise you lock yourself out)
that will be used to ssh to the simulation_host. This info should also appear
in .ssh/config (which makes it transparent for BackupPC).
Next, symlink all needed directories to /home/chrooted_user/, with the correct
permissions.
That should allow you to create a complete simulated client.
More details on this example will follow
=head2 Example 3 : simulating with SMB
TODO. Somebody?
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/