#!/usr/bin/env perl

use warnings;
use strict;

# check prerequisites
install rsbackup.pm in /opt/camp/rsbackup

# copy bin's into /opt/camp
mkdir -p /opt/camp/rsbackup/rsbackup_p2p
mv rsbackup_p2p /opt/camp/rsbackup/rsbackup_p2p/
mv scripts /opt/camp/rsbackup/rsbackup_p2p
chown -fRv root:root /opt/camp/rsbackup
chmod 700 /opt/camp/rsbackup/rsbackup_p2p/rsbackup_p2p
chmod 700 /opt/camp/rsbackup/rsbackup_p2p/scripts/*

# now, set up configuration file
mkdir -p /etc/camp/rsbackup_p2p
mv rsbackup_p2p.conf.template /etc/camp/rsbackup_p2p/rsbackup_p2p.conf
mv cleanup initialize /etc/camp/rsbackup_p2p/

clean up backups in database (backups, backups_server, etc...)
