Herzlich willkommen im Archiv vom ABAKUS Online Marketing Forum
Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.
Code: Alles auswählen
#!/bin/bash
cd /
mkdir -p /root/backup/temp/
tar -zcf /root/backup/temp/backup-etc.tar.gz /etc/
# paketdatenbank sichern
# dpkg --set-selections < datei
# aptitude aufrufen um rueckzusichern
dpkg --get-selections > /root/backup/temp/package-list
# mysql sichern
# .my.cnf anlegen und in /root/ speichern, dort passwort hinterlegen
mysqldump -u root -A | gzip -c > /root/backup/temp/mysql-dump.sql.gz
# www sichern
tar -zcf /root/backup/temp/backup-www.tar.gz /var/www/
# mail warnungs templates sichern
tar -zcf /root/backup/temp/backup-usr-local.tar.gz /usr/local/etc/
# bayes rules sichern
tar -zcf /root/backup/temp/backup-spamassassin.tar.gz /var/lib/amavis/.spamassassin
# mailsystem sichern
tar -zcf /root/backup/temp/backup-mailsystem.tar.gz /home/mailsystem/
# alle skripte sichern
tar -zcf /root/backup/temp/backup-skripte.tar.gz /root/scripts/
# alles in eine datei schnueren
tar -cf /root/backup/$(date +%Y-%m-%d).tar /root/backup/temp/
# und das temp verzeichnis entfernen
rm -rf /root/backup/temp/
So hab ichs dann auch gemacht. as zip selber wollte nicht, aber tar wollte. Uff...kostaki hat geschrieben:tar -czvf archive.tar.gz / geht nicht? Wenn er bei einigen Verzeichnissen abbricht, diese einfach excluden.
https://www.space.fmi.fi/~pjanhune/doc/ ... html#ss2.3It is not usually a good idea to use gzip with tape backups. If a single bit error occurs, it can corrupt the whole backup. Plain tar format is more tolerant to errors, in the best case only one file is damaged by a tape bit error.