ich "liebe" backup2l und konnte mich nicht damit abfinden, dass ein automatischer Abgleich mit einem FTP-Server nicht funktioniert. Rsync stand mir nicht zur Verfügung, also habe ich eine andere Lösung gefunden. Und die möchte ich Euch nicht vorenthalten. Kommentare ausdrücklich erwünscht, wenn keine Bedenken auftauchen, wäre dieses dann ein Vorschlag für die FAQ.
-----
Anleitung für SuSE 9.1, getestet auf Strato-Server, dürfte aber auch bei 1+1 & Co. funktionieren
BACKUP-LÃ?SUNG auf FTP-Server mit backup2l und sitecopy
1. backup2l installieren und einrichten
2. sitecopy installieren und einrichten
3. Cron-Job anpassen
1. backup2l installieren und einrichten
---------------------------------------
Wir arbeiten als root.
Zunächst legen wir ein Backup-Verzeichnis an:
Code: Select all
# mkdir /backup
# chmod 700 /backup
Code: Select all
# wget http://voxel.dl.sourceforge.net/sourceforge/backup2l/backup2l_1.3.tar.gz
Code: Select all
# tar -xzf backup2l_1.3.tar.gz
# cd backup2l-1.3
# ./install-sh
Wir bearbeiten die Konfigurationsdatei:
Code: Select all
# vi /etc/backup2l.conf
Code: Select all
Zeile 25:
< SRCLIST=(/etc /root /home /var/mail /usr/local)
> SRCLIST=(/boot /etc /home /root /var/lib/mysql /var/log /var/spool/mail /var/spool/cron /var/mail /usr/local)
Zeile 49:
< BACKUP_DIR="/disk2/backup"
> BACKUP_DIR="/backup"
Zeile 110:
< UNCONFIGURED=1
> # UNCONFIGURED=1 
2. sitecopy installieren und einrichten
---------------------------------------
Wir arbeiten nun zunächst als beschränkter Nutzer.
Aktuelle Programmversion herunterladen (zurzeit die 0.14-2):
Code: Select all
# wget http://www.lyra.org/sitecopy/sitecopy-0.14.2.tar.gz
Code: Select all
# tar -xzf sitecopy-0.14.2.tar.gz
# cd sitecopy-0.14.2
# ./configure
# make
# su
# make install
Konfigurationsdatei anlegen (wir bleiben root):
Code: Select all
# mkdir -m 700 /root/.sitecopy
# touch /root/.sitecopyrc
# chmod 600 /root/.sitecopyrc
# vi /root/.sitecopyrc
Inhalt dieser Konfigurationsdatei:
Code: Select all
site backup
  server <backupserver>
  remote /backup
  local /backup
  username <nutzername>
  password <passwort>
Code: Select all
# ftp <backupserver>
ftp> mkdir backup
ftp> bye
Code: Select all
# /usr/local/bin/sitecopy --init backup
3. Cron-Job anpassen
----------------------
Code: Select all
# vi /etc/cron.daily/zz-backup2l
Code: Select all
#!/bin/bash
# The following command invokes 'backup2l' with the default configuration
# file (/etc/backup2l.conf).
#
# (Re)move it or this entire script if you do not want automatic backups.
#
# Redirect its output if you do not want automatic e-mails after each backup.
PATH=$PATH:/usr/local/bin
! which backup2l > /dev/null || nice -19 backup2l -b
/usr/local/bin/sitecopy -u backup
Code: Select all
#!/bin/bash
# The following command invokes 'backup2l' with the default configuration
# file (/etc/backup2l.conf).
#
# (Re)move it or this entire script if you do not want automatic backups.
#
# Redirect its output if you do not want automatic e-mails after each backup.
PATH=$PATH:/usr/local/bin
! which backup2l > /dev/null || nice -19 backup2l -b
/usr/local/bin/sitecopy -u backup > /dev/null
Nun wird jede Nacht (bei Strato gegen 4:14 Uhr) ein Backup angelegt und der Backup-Server mit dem Backup synchronisiert (d. h. neue Dateien hochgeladen, obsolete Dateien werden automatisch gelöscht).