--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- E-Mails sichern ------------------------- Son Nov 25 19:10:18 MET 2001 ------------------------- E-Mail Mails sichern Backup cron tar bzip2 ----------------------------------------------------------------------------- Sie wollen Ihre E-Mails sichern. Hier ein primitiver Vorschlag. ----------------------------------------------------------------------------- Es ist simpel, aber wirkungsvoll: Am ersten eines Monats (wer wirklich viel Mails bekommt, sollte das Backup einmal pro Woche ausführen lassen...) wird via tar und bzip2 der gesamte E-Mail-Bestand (von ~/Mail) nach ~/Mail/backup gesichert. Es ist jediglich folgende Zeile nach Aufruf von crontab -e einzugeben: --------CODE--------: Die neue crontab */30 * 1 * * /home//Mail/backup/backup.sh --------/CODE-------- Das Skript backup.sh: --------CODE--------: backup.sh #!/bin/bash # backup.sh - Backups your e-mails. # Copyright (C) Son Nov 25 19:15:35 MET 2001 - now by Ingo Blechschmidt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Ingo Blechschmidt # Arberstraße 5 # 86179 Augsburg # E-Mail: iblech@web.de, http://www.way.to/uselinux/ # Tel.: +49 / 821 882955 # # [ -e ~/Mail/backup/l ] || > ~/Mail/backup/l if [ ! "`cat ~/Mail/backup/l`" = "`date +%d`" ]; then tar --preserve --create --bzip2 --verbose --verbose --file ~/Mail/backup/`date +%d.%m.%Y`.tar.bz2 --exclude=backup --remove-files ~/Mail date +%d > ~/Mail/backup/l fi --------/CODE-------- Einfach, aber für einfache Anwendungen erfüllt das Skript seinen Zweck. Natürlich könnte man hier noch weitere Funktionen einbauen: In dieser Form archiviert backup.sh auch E-Mails, die sie noch gar nicht gelesen haben. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This document is distributed under the terms of the GNU Free Documentation License.