#!/bin/sh ## Backup - packen echo "Backup Phase 1: packen " tar -cjf /backup/archives/etc.tar.bz2 /etc/ tar -cjf /backup/archives/root.tar.bz2 /root/ exit 0;
#!/bin/bash echo "Backup Phase 3: cleanup" rm -rf /backup/archives/* exit 0;
#!/bin/sh ## Backup Newton echo "Backup Newton Phase 1: packen" tar -cjf /backup/archives/newton/etc.tar.bz2 /etc/ tar -cjf /backup/archives/newton/root.tar.bz2 /root/ exit 0;
#!/bin/sh ## Backup Serverdaten echo "Backup Serverdaten Phase 1: packen" tar -cjf /backup/archives/einstein/einstein.tar.bz2 /daten/einstein/ exit 0;
#!/bin/sh echo "Backup Newton/Serverdaten Phase 3: cleanup" rm -rf /backup/archives/einstein/* rm -rf /backup/archives/hawking/* rm -rf /backup/archives/kepler/* rm -rf /backup/archives/s4e/* rm -rf /backup/archives/newton/* exit 0;
#!/bin/sh ## bgweiz Serverbackup - Startskript echo "Starte remote Backupprozesse..." ssh root@10.67.0.1 /backup/backup.sh ## Einstein ssh root@10.67.0.2 /backup/backup.sh ## Hawking ssh root@10.67.0.6 /backup/backup.sh ## server4education ssh root@10.67.0.5 /backup/backup.sh ## Kepler ssh root@10.67.0.254 /backup/backup_newton.sh ## Newton #ssh root@10.67.0.254 /backup/backup_daten.sh ## komplette Serverdaten auf Newton echo "Stoppe empfindliche Serverdienste & sichere Serverdaten..." #s4e ssh root@10.67.0.254 /backup/backup_s4e.sh ## server4education #e4s ## Einstein ssh root@10.67.0.1 /etc/init.d/apache2 stop ssh root@10.67.0.1 /etc/init.d/mysql stop ssh root@10.67.0.1 /etc/init.d/postfix stop ssh root@10.67.0.1 /etc/init.d/named stop ssh root@10.67.0.254 /backup/backup_einstein.sh ssh root@10.67.0.1 /etc/init.d/apache2 start ssh root@10.67.0.1 /etc/init.d/mysql start ssh root@10.67.0.1 /etc/init.d/postfix start ssh root@10.67.0.1 /etc/init.d/named start ## nietsiE ## Hawking ssh root@10.67.0.2 /etc/init.d/named stop ssh root@10.67.0.254 /backup/backup_hawking.sh ssh root@10.67.0.2 /etc/init.d/named start ## gnikwaH ## Kepler ssh root@10.67.0.5 /etc/init.d/smb stop ssh root@10.67.0.5 /etc/init.d/nmb stop #ssh root@10.67.0.5 /etc/init.d/ldap stop #ssh root@10.67.0.5 /etc/init.d/slurpd stop ssh root@10.67.0.254 /etc/backup/backup_kepler.sh ssh root@10.67.0.5 /etc/init.d/smb start ssh root@10.67.0.5 /etc/init.d/nmb start #ssh root@10.67.0.5 /etc/init.d/ldap start #ssh root@10.67.0.5 /etc/init.d/slurpd start ## relpeK echo "Starte rsync Uebertragung..." ## Einstein rsync -rblpogD root@10.67.0.1:/backup/archives/* /daten/backup_rsync/einstein/ rsync -rblpogD root@10.67.0.254:/backup/archives/einstein/* /daten/backup_rsync/einstein/ date | tee /daten/backup_rsync/einstein/timestamp ## Hawking rsync -rblpogD root@10.67.0.2:/backup/archives/* /daten/backup_rsync/hawking/ rsync -rblpogD root@10.67.0.254:/backup/archives/hawking/* /daten/backup_rsync/hawking/ date | tee /daten/backup_rsync/hawking/timestamp ## server4education rsync -rblpogD root@10.67.0.6:/backup/archives/* /daten/backup_rsync/s4e/ rsync -rblpogD root@10.67.0.254:/backup/archives/s4e/* /daten/backup_rsync/s4e/ date | tee /daten/backup_rsync/s4e/timestamp ## Kepler rsync -rblpogD root@10.67.0.5:/backup/archives/* /daten/backup_rsync/kepler/ rsync -rblpogD root@10.67.0.254:/backup/archives/kepler/* /daten/backup_rsync/kepler/ date | tee /daten/backup_rsync/kepler/timestamp ## Newton rsync -rblpogD root@10.67.0.254:/backup/archives/newton/* /daten/backup_rsync/newton/ date | tee /daten/backup_rsync/newton/timestamp echo "rsync Uebertragung abgeschlossen" echo "Cleaning up..." ssh root@10.67.0.1 /backup/cleanup.sh ssh root@10.67.0.2 /backup/cleanup.sh ssh root@10.67.0.6 /backup/cleanup.sh ssh root@10.67.0.5 /backup/cleanup.sh ssh root@10.67.0.254 /backup/cleanup.sh sh /daten/backup_rsync/archiv.sh exit 0; # :wq
#!/bin/sh ## Archivierung echo "Archiviere Backup..." mv /daten/backup_rsync /daten/backup.`date -d "now" +%Y-%m-%d` echo "Bereite Verzeichnis fuer neues Backup vor.." mkdir /daten/backup_rsync mkdir /daten/backup_rsync/einstein mkdir /daten/backup_rsync/hawking mkdir /daten/backup_rsync/s4e mkdir /daten/backup_rsync/kepler mkdir /daten/backup_rsync/newton cp /daten/scripts/* /daten/backup_rsync/
Diese Methode benoetigt sehr oft Passwort eingaben, dies ließe sich umgehen, indem man dem Backupserver die entsprechenden ssh-keys verpasst(siehe ssh_schluessel_-_anmeldung_ohne_passwort ), aber das wuerde bedeuten, dass jeder der Zugriff auf Feynman erlangt, automatisch auch Zugriff auf alle gesicherten Server hat, da kein Passwort für ssh-Verbindungen benoetigt wird. Alternativ koennte man auch statt root einen speziellen backup-user benutzen, doch muss hier auf die Rechte geachtet werden, weiters benoetigen einige rsync-Optionen root-Rechte.