BackupPC

http://backuppc.sourceforge.net/

  1. install backupppc…
  2. move /var/lib/backuppc a udelat link
  3. konfigurace hosts
  4. nainstalovat apt-get install sysstat iotop a naladit velikost pameti (inc zaloha post nestaci 1.3GB)

TKL Fileserver Install

apt-get -y install backuppc libfile-rsyncp-perl libio-dirent-perl par2 apache2-utils smbclient
ln -s /etc/lighttpd/conf-available/05-auth.conf /etc/lighttpd/conf-enabled/05-auth.conf
ln -s /etc/lighttpd/conf-available/10-cgi.conf /etc/lighttpd/conf-enabled/10-cgi.conf
wget -O /etc/lighttpd/conf-available/90-backuppc.conf 'http://www.heca.net/_export/code/admin/backuppc?codeblock=1'
ln -s /etc/lighttpd/conf-available/90-backuppc.conf /etc/lighttpd/conf-enabled/90-backuppc.conf
htpasswd -bm /etc/backuppc/htpasswd backuppc SECRET
cd /etc
git add .
git commit -m "install backuppc"
mkdir -p /srv/storage/backup/
cp -a /var/lib/backuppc /srv/storage/backup
rm -rf /var/lib/backuppc
ln -s /srv/storage/backup/backuppc /var/lib/backuppc
/etc/init.d/lighttpd restart
/etc/init.d/backuppc restart
90-backuppc.conf
alias.url  += ( "/backuppc" => "/usr/share/backuppc/cgi-bin" )
 
index-file.names += ( "index.cgi" )
 
cgi.assign += ( ".cgi" => "/usr/bin/perl")
 
$HTTP["url"] =~ "^/backuppc" {
  auth.backend = "htpasswd"
  auth.backend.htpasswd.userfile = "/etc/backuppc/htpasswd"
  auth.require = ("/backuppc" => (
     "method"  => "basic",
     "realm"   => "BackupPC",
     "require" => "valid-user"
  ))
}

Nastavení klíčů pro rsync

su -s /bin/bash backuppc
ssh-keygen
ssh-copy-id root@HOST

update backuppc from backport

sed -i 's/^#\s*\(deb.*backports .*\)/\1/' /etc/apt/sources.list.d/sources.list
apt-get update
apt-get -y install backuppc
sed -i 's/^\(deb.*backports .*\)/# \1/' /etc/apt/sources.list.d/sources.list
apt-get update

install on core openvz

sed -i 's/^#\s*\(deb.*backports .*\)/\1/' /etc/apt/sources.list.d/sources.list
apt-get update
apt-get -y install lighttpd backuppc libfile-rsyncp-perl apache2-utils
sed -i 's/^\(deb.*backports .*\)/# \1/' /etc/apt/sources.list.d/sources.list
apt-get update
lighty-enable-mod auth
lighty-enable-mod cgi
wget -O /etc/lighttpd/conf-available/90-backuppc.conf 'http://www.heca.net/_export/code/admin/backuppc?codeblock=1'
lighty-enable-mod backuppc
htpasswd -bm /etc/backuppc/htpasswd backuppc SECRET

dump mysql pred zalohovanim

DumpPreUserCmd = $sshPath -q -x -l root $host /usr/local/sbin/mysqlbackup

optimalizace

Vice jader a hodne pameti na 3 vlakna 4 jadra a 4GB RAM, ale zalezi na souborech.

Velke soubory dat samostatne na nekompresovany host.

/etc/fstab

/dev/mapper/data-backup /srv/storage    ext3    defaults,noatime,data=writeback,nobh,commit=90        0       2

/etc/rc.local

# zmena casovani ext3 ukladani nadisk
# http://sourceforge.net/apps/mediawiki/backuppc/index.php?title=Speedupbackups
echo 50 > /proc/sys/vm/dirty_ratio
echo 50 > /proc/sys/vm/dirty_background_ratio
echo 6000 > /proc/sys/vm/dirty_writeback_centisecs
echo 6000 > /proc/sys/vm/dirty_expire_centisecs
 
# zmena scheduleru pro zalohovaci disky
# http://www.cyberciti.biz/faq/linux-change-io-scheduler-for-harddisk/#comments
echo anticipatory > /sys/block/sdb/queue/scheduler
echo anticipatory > /sys/block/dm-0/queue/scheduler