Shell Skript: Cyrus Recovery Script V2
Mit diesem Skript können Sie ein Cyrus-Backup (siehe Shell Skript: Cyrus Backup Script V2) wiederherstellen. Bevor Sie das Skript ausführen, sollten Sie den Backuppfad anpassen.
Hinweis: Dieses Skript ist für SUSE Linux 9.3 bis openSUSE 10.2 ausgelegt.
###########################################################################
## ##
## Cyrus Recovery Script V2 ##
## ##
## Creation: 16.06.2005 ##
## Last Update: 18.06.2005 ##
## ##
## Copyright (c) 2004-2005 by Georg Kainzbauer <http://www.gtkdb.de> ##
## ##
## 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. ##
## ##
###########################################################################
#!/bin/bash
BACKUPDIR=/data/images/GHOST/backup/cyrus/
LOGFILE=/var/log/mylogs/cyrus_recovery.log
echo "`date "+%b %e %X"`: Shutting down Mailsystem" >> ${LOGFILE}
rcfetchmail stop
rcpostfix stop
rccyrus stop
echo "`date "+%b %e %X"`: Starting Recoveryprocess" >> ${LOGFILE}
tar xvjpf ${BACKUPDIR}cyrus_backup.tar.bz2 -C /
if [ -f /var/lib/imap/mailboxes.db ]
then
rm /var/lib/imap/mailboxes.db
fi
su - cyrus -c "ctl_mboxlist -u" < /var/tmp/mailboxlist.txt
rm /var/tmp/mailboxlist.txt
echo "`date "+%b %e %X"`: Starting Mailsystem" >> ${LOGFILE}
rccyrus start
rcpostfix start
rcfetchmail start
## ##
## Cyrus Recovery Script V2 ##
## ##
## Creation: 16.06.2005 ##
## Last Update: 18.06.2005 ##
## ##
## Copyright (c) 2004-2005 by Georg Kainzbauer <http://www.gtkdb.de> ##
## ##
## 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. ##
## ##
###########################################################################
#!/bin/bash
BACKUPDIR=/data/images/GHOST/backup/cyrus/
LOGFILE=/var/log/mylogs/cyrus_recovery.log
echo "`date "+%b %e %X"`: Shutting down Mailsystem" >> ${LOGFILE}
rcfetchmail stop
rcpostfix stop
rccyrus stop
echo "`date "+%b %e %X"`: Starting Recoveryprocess" >> ${LOGFILE}
tar xvjpf ${BACKUPDIR}cyrus_backup.tar.bz2 -C /
if [ -f /var/lib/imap/mailboxes.db ]
then
rm /var/lib/imap/mailboxes.db
fi
su - cyrus -c "ctl_mboxlist -u" < /var/tmp/mailboxlist.txt
rm /var/tmp/mailboxlist.txt
echo "`date "+%b %e %X"`: Starting Mailsystem" >> ${LOGFILE}
rccyrus start
rcpostfix start
rcfetchmail start
Dieser Eintrag wurde am 19.06.2005 erstellt und zuletzt am 24.01.2016 bearbeitet.
Direkter Link zu dieser Seite: http://www.gtkdb.de/index_35_837.html
[ Zur Startseite ] [ Zur Kategorie ]
© 2004-2021 by Georg Kainzbauer