Linux: postfix backup
Postfix ist von seiner Verzeichniss Struktur relativ einfach gehalten und lässt sich daher auch gut sichern. Für die tägliche Sicherung bietet sich ein script an. ich benutzte dafür folgendes:
#!/bin/shBACKUP_DIR="/backup/" set $(date) str_Tag=$(date +%A);echo "postfix backup"echo -n " creating directories" rm -rf $BACKUP_DIR/postfix mkdir -p $BACKUP_DIR/var/spool mkdir -p $BACKUP_DIR/etc echo -e "33[40;1;32m OK 33[0m"echo -n " first rsync pass" rsync -rq /var/spool/postfix $BACKUP_DIR/var/spool rsync -rq /etc/postfix $BACKUP_DIR/etc/ echo -e "33[40;1;32m OK 33[0m"echo -n " stop postfix" postfix stop > /dev/null 2>&1 echo -e "33[40;1;32m OK 33[0m"echo -n " second rsync pass" rsync -rq /var/spool/postfix $BACKUP_DIR/var/spool rsync -rq /etc/postfix $BACKUP_DIR/etc echo -e "33[40;1;32m OK 33[0m"echo -n " start postfix again" postfix start > /dev/null 2>&1 echo -e "33[40;1;32m OK 33[0m"echo -n " compressing backup" tar cfvz $BACKUP_DIR/$6.$3.$2_postfix.tar.gz $BACKUP_DIR/etc/postfix $BACKUP_DIR/var/spool/postfix > /dev/null 2>&1 rm -r $BACKUP_DIR/etc $BACKUP_DIR/var echo -e "33[40;1;32m OK 33[0"
Zuletzt aktualisiert: 20. Juni 2009 — 14:42