Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:dovecot_backup_-_skript

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
tachtler:dovecot_backup_-_skript [2018/08/06 09:08]
klaus [Skript]
tachtler:dovecot_backup_-_skript [2019/01/31 07:04] (aktuell)
klaus [Skript]
Zeile 12: Zeile 12:
  
 ^ Beschreibung ​ ^ Externer Link                                                                   ^ ^ Beschreibung ​ ^ Externer Link                                                                   ^
 +| Linux-Magazin | [[http://​www.linux-magazin.de/​ausgaben/​2018/​06/​backups-von-e-mails/​|Wie Admins ihre Mailserver vor Datenverlust schützen]] / {{ :​tachtler:​protected:​054-058_email_backup_v2.pdf |Artikel aus Ausgabe 06/2018}} |
 | Homepage ​     | [[http://​dovecot.org|http://​dovecot.org]] ​                                      | | Homepage ​     | [[http://​dovecot.org|http://​dovecot.org]] ​                                      |
 | Dokumentation | [[http://​dovecot.org/​documentation.html|http://​dovecot.org/​documentation.html]] | | Dokumentation | [[http://​dovecot.org/​documentation.html|http://​dovecot.org/​documentation.html]] |
Zeile 26: Zeile 27:
 Nachfolgendes Skript ermöglicht die Erstellung einer ***.tar.gz**-Datei ​ Nachfolgendes Skript ermöglicht die Erstellung einer ***.tar.gz**-Datei ​
   * von **__allen__** Benutzerkonten   * von **__allen__** Benutzerkonten
 +  * **__oder__** über **__eine Datei mit E-Mail-Adressen__**,​ der zu sichernden Benutzerkonten
   * pro **__Benutzer eine eigene *.tar.gz-Datei__**   * pro **__Benutzer eine eigene *.tar.gz-Datei__**
   * auf **__Dateiebene__**   * auf **__Dateiebene__**
Zeile 44: Zeile 46:
  
 # CUSTOM - Backup-Files. # CUSTOM - Backup-Files.
-DIR_BACKUP='​srv/​backup'​+DIR_BACKUP='​/srv/​backup'​
 FILE_BACKUP=dovecot_backup_`date '​+%Y%m%d_%H%M%S'​`.tar.gz FILE_BACKUP=dovecot_backup_`date '​+%Y%m%d_%H%M%S'​`.tar.gz
 FILE_DELETE='​*.tar.gz'​ FILE_DELETE='​*.tar.gz'​
-BACKUPFILES_DELETE=7+BACKUPFILES_DELETE=14
  
 # CUSTOM - dovecot Folders. # CUSTOM - dovecot Folders.
Zeile 54: Zeile 56:
 MAILDIR_USER='​vmail'​ MAILDIR_USER='​vmail'​
 MAILDIR_GROUP='​vmail'​ MAILDIR_GROUP='​vmail'​
 +
 +# CUSTOM - Path and file name of a file with e-mail addresses to backup, if
 +#          SET. If NOT, the script will determine all mailboxes by default.
 +# FILE_USERLIST='/​path/​and/​file/​name/​of/​user/​list/​with/​one/​email/​per/​line'​
 +# - OR -
 +# FILE_USERLIST=''​
 +FILE_USERLIST=''​
 +
 +# CUSTOM - Check when FILE_USERLIST was used, if the user per line was a
 +#          valid e-mail address [Y|N].
 +FILE_USERLIST_VALIDATE_EMAIL='​N'​
  
 # CUSTOM - Mail-Recipient. # CUSTOM - Mail-Recipient.
Zeile 77: Zeile 90:
 | ''​MAILDIR_USER'' ​      | Benutzername unter dem alle Postfächer (Mailboxes) verwaltet werden, **siehe auch:**\\ [[tachtler:​dovecot_centos_6#​authentifizierungsbenutzer|Dovecot CentOS 6 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]]\\ [[tachtler:​dovecot_centos_7#​authentifizierungsbenutzer|Dovecot CentOS 7 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]] ​   | | ''​MAILDIR_USER'' ​      | Benutzername unter dem alle Postfächer (Mailboxes) verwaltet werden, **siehe auch:**\\ [[tachtler:​dovecot_centos_6#​authentifizierungsbenutzer|Dovecot CentOS 6 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]]\\ [[tachtler:​dovecot_centos_7#​authentifizierungsbenutzer|Dovecot CentOS 7 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]] ​   |
 | ''​MAILDIR_GROUP'' ​     | Benutzergruppe unter dem alle Postfächer (Mailboxes) verwaltet werden, **siehe auch:**\\ [[tachtler:​dovecot_centos_6#​authentifizierungsbenutzer|Dovecot CentOS 6 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]]\\ [[tachtler:​dovecot_centos_7#​authentifizierungsbenutzer|Dovecot CentOS 7 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]] ​ | | ''​MAILDIR_GROUP'' ​     | Benutzergruppe unter dem alle Postfächer (Mailboxes) verwaltet werden, **siehe auch:**\\ [[tachtler:​dovecot_centos_6#​authentifizierungsbenutzer|Dovecot CentOS 6 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]]\\ [[tachtler:​dovecot_centos_7#​authentifizierungsbenutzer|Dovecot CentOS 7 - Konfiguration Authentifizierung - Authentifizierungsbenutzer]] ​ |
 +| ''​FILE_USERLIST'' ​     | **Datei** mit Benutzernamen (einer pro Zeile), welche Mailboxen/​Benutzer gesichert werden, anstelle der Ermittlung durch ''​doveadm user ”*”'',​ um nicht alle Mailboxen/​Benutzer zwangsweise zu sichern |
 +| ''​FILE_USERLIST_VALIDATE_EMAIL''​ | Überprüfung des Benutzernamens,​ ob dieser eine gültige E-Mail Adresse darstellt. **Muss dann __deaktiviert__ werden, wenn der Benutzername keine E-Mail Adresse ist!** |
 +| ''​MAIL_RECIPIENT'' ​    | **Empfänger** E-Mail-Adresse für E-Mails des Skripts |
 +| ''​MAIL_STATUS'' ​       | Versand einer **Status** E-Mail nach erfolgreicher Skript Ausführung |
  
 ==== /​var/​lib/​dovecot ==== ==== /​var/​lib/​dovecot ====
Zeile 109: Zeile 126:
 #               will be send by e-mail. ​                                     # #               will be send by e-mail. ​                                     #
 #                                                                            # #                                                                            #
-# Last update : 06.08.2018                                                   # +# Last update : 31.01.2019                                                   # 
-# Version ​    : 1.06                                                         #+# Version ​    : 1.10                                                         #
 #                                                                            # #                                                                            #
 # Author ​     : Klaus Tachtler, <​klaus@tachtler.net> ​                        # # Author ​     : Klaus Tachtler, <​klaus@tachtler.net> ​                        #
Zeile 123: Zeile 140:
 #  +----------------------------------------------------------------------+ ​ # #  +----------------------------------------------------------------------+ ​ #
 #                                                                            # #                                                                            #
-# Copyright (c) 2018 by Klaus Tachtler. ​                                     #+# Copyright (c) 2019 by Klaus Tachtler. ​                                     #
 #                                                                            # #                                                                            #
 ##############################################################################​ ##############################################################################​
Zeile 167: Zeile 184:
 #               ​Change file owner, after backup was created. ​                # #               ​Change file owner, after backup was created. ​                #
 #               ​Change file permissions to 600, after backup was created. ​   # #               ​Change file permissions to 600, after backup was created. ​   #
-#               ​Thanks to Seep1959 ​                                          ​#+#               ​Thanks to Seep1959.                                          # 
 +# -------------------------------------------------------------------------- # 
 +# Version ​    : 1.07                                                         # 
 +# Description : Compatibility:​ Change the parameter order for the step       # 
 +#               "​Delete archive files for user" for better compatibility ​    # 
 +#               with FreeBSD. ​                                               # 
 +#               ​Thanks to Alexander Preyer. ​                                 # 
 +# -------------------------------------------------------------------------- # 
 +# Version ​    : 1.08                                                         # 
 +# Description : GitHub Issue #9                                              # 
 +#               Add ability to only backup specific mailboxes, by using the  #  
 +#               ​variable FILE_USERLIST with the file path and file name as   # 
 +#               ​content. The file must contain one e-mail address per line.  # 
 +#               Add the calculation of the script runtime. ​                  # 
 +#               ​Thanks to graue Ritter. ​                                     # 
 +# -------------------------------------------------------------------------- # 
 +# Version ​    : 1.09                                                         # 
 +# Description : Add a switch to enable or disable e-mail address check, when # 
 +#               ​FILE_USERLIST was set and used.                              # 
 +#               ​Thanks to kbridger. ​                                         # 
 +# -------------------------------------------------------------------------- # 
 +# Version ​    : 1.10                                                         # 
 +# Description : Code redesign. ​                                              #
 # -------------------------------------------------------------------------- # # -------------------------------------------------------------------------- #
 # Version ​    : x.xx                                                         # # Version ​    : x.xx                                                         #
Zeile 192: Zeile 231:
 MAILDIR_USER='​vmail'​ MAILDIR_USER='​vmail'​
 MAILDIR_GROUP='​vmail'​ MAILDIR_GROUP='​vmail'​
 +
 +# CUSTOM - Path and file name of a file with e-mail addresses to backup, if
 +#          SET. If NOT, the script will determine all mailboxes by default.
 +# FILE_USERLIST='/​path/​and/​file/​name/​of/​user/​list/​with/​one/​user/​per/​line'​
 +# - OR -
 +# FILE_USERLIST=''​
 +FILE_USERLIST=''​
 +
 +# CUSTOM - Check when FILE_USERLIST was used, if the user per line was a
 +#          valid e-mail address [Y|N].
 +FILE_USERLIST_VALIDATE_EMAIL='​N'​
  
 # CUSTOM - Mail-Recipient. # CUSTOM - Mail-Recipient.
Zeile 214: Zeile 264:
 CHOWN_COMMAND=`command -v chown` CHOWN_COMMAND=`command -v chown`
 CHMOD_COMMAND=`command -v chmod` CHMOD_COMMAND=`command -v chmod`
 +GREP_COMMAND=`command -v grep`
 FILE_LOCK='/​tmp/'​$SCRIPT_NAME'​.lock'​ FILE_LOCK='/​tmp/'​$SCRIPT_NAME'​.lock'​
 FILE_LOG='/​var/​log/'​$SCRIPT_NAME'​.log'​ FILE_LOG='/​var/​log/'​$SCRIPT_NAME'​.log'​
Zeile 222: Zeile 273:
 VAR_SENDER='​root@'​$VAR_HOSTNAME VAR_SENDER='​root@'​$VAR_HOSTNAME
 VAR_EMAILDATE=`$DATE_COMMAND '+%a, %d %b %Y %H:%M:%S (%Z)'` VAR_EMAILDATE=`$DATE_COMMAND '+%a, %d %b %Y %H:%M:%S (%Z)'`
 +declare -a VAR_LISTED_USER=()
 declare -a VAR_FAILED_USER=() declare -a VAR_FAILED_USER=()
 VAR_COUNT_USER=0 VAR_COUNT_USER=0
Zeile 243: Zeile 295:
  
 function movelog() { function movelog() {
-        ​$CAT_COMMAND $FILE_LAST_LOG >> $FILE_LOG + $CAT_COMMAND $FILE_LAST_LOG >> $FILE_LOG 
-        $RM_COMMAND -f $FILE_LAST_LOG + $RM_COMMAND -f $FILE_LAST_LOG  
-        $RM_COMMAND -f $FILE_LOCK+ $RM_COMMAND -f $FILE_LOCK
 } }
  
Zeile 274: Zeile 326:
 } }
  
-Main+function error () { 
-log "+ Parameters
-log "​+-----------------------------------------------------------------+"​ + CODE_ERROR="$1"
-log "| Start backup the mailboxes of dovecot server................... |" +
-log "​+-----------------------------------------------------------------+"​ +
-log ""​ +
-log "Run script with following parameter:"​ +
-log ""​ +
-log "​SCRIPT_NAME...: ​$SCRIPT_NAME"​ +
-log ""​ +
-log "​DIR_BACKUP....:​ $DIR_BACKUP"​ +
-log ""​ +
-log "​MAIL_RECIPIENT:​ $MAIL_RECIPIENT"​ +
-log "​MAIL_STATUS...:​ $MAIL_STATUS"​ +
-log ""+
  
-# Check if command (file) NOT exist OR IS empty. 
-if [ ! -s "​$DSYNC_COMMAND"​ ]; then 
-        log "Check if command '​$DSYNC_COMMAND'​ was found....................[FAILED]"​ 
         sendmail ERROR         sendmail ERROR
-        ​movelog + movelog 
-        exit 11 + exit $CODE_ERROR 
-else +}
-        log "Check if command '$DSYNC_COMMAND'​ was found....................[ ​ OK  ]" +
-fi+
  
-# Check if command ​(fileNOT exist OR IS empty. +function headerblock ​() { 
-if [ ! -s "​$TAR_COMMAND"​ ]; then + # Parameters
-        log "Check if command '​$TAR_COMMAND'​ was found......................[FAILED]"​ + TEXT_INPUT="$1
-        ​sendmail ERROR + LINE_COUNT=68
-        movelog +
-        exit 12 +
-else +
-        log "Check if command '$TAR_COMMAND'​ was found......................[ ​ OK  ]+
-fi+
  
-Check if command (file) NOT exist OR IS empty+        ​Help variables
-if [ ! -s "​$TOUCH_COMMAND"​ ]; then +        ​WORD_COUNT=`echo $TEXT_INPUT | wc -c` 
-        ​log "Check if command '$TOUCH_COMMAND'​ was found....................[FAILED]"​ +        ​CHAR_AFTER=`expr ​$LINE_COUNT - $WORD_COUNT - 5` 
-        ​sendmail ERROR +        ​LINE_SPACE=`expr ​$LINE_COUNT - 3`
-        movelog +
-        exit 13 +
-else +
-        log "Check if command '$TOUCH_COMMAND'​ was found....................[ ​ OK  ]" +
-fi+
  
-Check if command (file) NOT exist OR IS empty+ Format placeholder
-if [ ! -s "$RM_COMMAND" ]; then + if [ "$CHAR_AFTER"​ -lt "0" ]; then 
-        ​log ​"Check if command '​$RM_COMMAND'​ was found.......................[FAILED]"​ + CHAR_AFTER="0
-        sendmail ERROR + fi
-        movelog +
-        exit 14 +
-else +
-        log "Check if command '​$RM_COMMAND'​ was found.......................[ ​ OK  ]+
-fi+
  
-# Check if command (file) NOT exist OR IS empty. + printf ​-v char '%*s' $CHAR_AFTER '
-if [ ! -s "​$CAT_COMMAND"​ ]; then + printf -v line '%*s' $LINE_SPACE ''
-        log "Check if command ​'$CAT_COMMAND' ​was found......................[FAILED]"​ +
-        ​sendmail ERROR +
-        movelog +
-        exit 15 +
-else +
-        log "Check if command ​'$CAT_COMMAND' ​was found......................[ ​ OK  ]" +
-fi+
  
-# Check if command (file) NOT exist OR IS empty. + log "+${line// /-}+
-if [ ! -s "$DATE_COMMAND" ​]; then + log "$TEXT_INPUT${char//​ /.} |
-        log "Check if command '$DATE_COMMAND'​ was found.....................[FAILED]+ log "+${line// /-}+
-        ​sendmail ERROR +}
-        movelog +
-        exit 16 +
-else +
-        ​log "Check if command '$DATE_COMMAND'​ was found.....................[ ​ OK  ]+
-fi+
  
-# Check if command ​(fileNOT exist OR IS empty+function logline ​() 
-if [ ! -s "$MKDIR_COMMAND" ​]; then + # Parameters
-        ​log ​"Check if command '$MKDIR_COMMAND'​ was found....................[FAILED]"​ + TEXT_INPUT="$1
-        sendmail ERROR + TRUE_FALSE="$2
-        movelog + LINE_COUNT=68
-        exit 17 +
-else +
-        log "Check if command '​$MKDIR_COMMAND'​ was found....................[ ​ OK  ]+
-fi+
  
-Check if command (file) NOT exist OR IS empty. +        ​Help variables
-if [ ! -s "​$CHOWN_COMMAND"​ ]; then +        ​WORD_COUNT=`echo ​$TEXT_INPUT | wc -c` 
-        ​log "Check if command '$CHOWN_COMMAND'​ was found....................[FAILED]"​ +        ​CHAR_AFTER=`expr ​$LINE_COUNT - $WORD_COUNT - 9`
-        ​sendmail ERROR +
-        movelog +
-        exit 18 +
-else +
-        log "Check if command '$CHOWN_COMMAND'​ was found....................[ ​ OK  ]" +
-fi+
  
-Check if command ​(fileNOT exist OR IS empty+ Format placeholder. 
-if [ ! -s "$CHMOD_COMMAND" ]; then + if [ "​$CHAR_AFTER"​ -lt "​0"​ ]; then 
-        ​log ​"Check if command '$CHMOD_COMMAND' was found....................[FAILED]+ CHAR_AFTER="​0"​ 
-        ​sendmail ERROR + fi 
-        ​movelog + 
-        exit 19 + printf -v char '​%*s'​ $CHAR_AFTER ''​ 
-else + 
-        ​log "Check if command '$CHMOD_COMMAND'​ was found....................[  OK  ]+ if [ "​$TRUE_FALSE"​ == "​true"​ ]; then 
-fi+ log "​$TEXT_INPUT${char//​ /.}[  OK  ]" 
 + else 
 + log "​$TEXT_INPUT${char//​ /​.}[FAILED]"​ 
 + fi 
 +
 + 
 +function checkcommand ​() 
 + # Parameters. 
 +        CHECK_COMMAND="​$1"​ 
 + 
 + if [ ! -s "$1" ]; then 
 + logline ​"Check if command '$CHECK_COMMAND' was found " false 
 + error 10 
 + else 
 + logline "Check if command '​$CHECK_COMMAND'​ was found " true 
 + fi 
 +
 + 
 +# Main. 
 +log ""​ 
 +RUN_TIMESTAMP=`$DATE_COMMAND '​+%s'​` 
 +headerblock "Start backup of the mailboxes [`$DATE_COMMAND '+%a, %d %b %Y %H:%M:%S (%Z)'​`]"​ 
 +log ""​ 
 +log "​SCRIPT_NAME.................: $SCRIPT_NAME"​ 
 +log ""​ 
 +log "​DIR_BACKUP..................:​ $DIR_BACKUP
 +log ""​ 
 +log "MAIL_RECIPIENT..............: ​$MAIL_RECIPIENT"​ 
 +log "​MAIL_STATUS.................: $MAIL_STATUS"​ 
 +log ""​ 
 +log "​FILE_USERLIST...............:​ $FILE_USERLIST
 +log "​FILE_USERLIST_VALIDATE_EMAIL:​ $FILE_USERLIST_VALIDATE_EMAIL"​ 
 +log ""​
  
 # Check if command (file) NOT exist OR IS empty. # Check if command (file) NOT exist OR IS empty.
-if [ ! -s "$PROG_SENDMAIL"​ ]; then +checkcommand ​$DSYNC_COMMAND 
-        log "Check if command '$PROG_SENDMAIL'​ was found................[FAILED]"​ +checkcommand ​$TAR_COMMAND 
-        ​sendmail ERROR +checkcommand $TOUCH_COMMAND 
-        ​movelog +checkcommand $RM_COMMAND 
-        exit 20 +checkcommand $CAT_COMMAND 
-else +checkcommand $DATE_COMMAND 
-        log "Check if command '$PROG_SENDMAIL'​ was found................[ ​ OK  ]" +checkcommand ​$MKDIR_COMMAND 
-fi+checkcommand $CHOWN_COMMAND 
 +checkcommand $CHMOD_COMMAND 
 +checkcommand $GREP_COMMAND 
 +checkcommand $PROG_SENDMAIL
  
 # Check if LOCK file NOT exist. # Check if LOCK file NOT exist.
 if [ ! -e "​$FILE_LOCK"​ ]; then if [ ! -e "​$FILE_LOCK"​ ]; then
-        ​log "Check if script is NOT already runnig ​.....................[ ​ OK  ]"+        ​logline ​"Check if the script is NOT already runnig " ​true
  
         $TOUCH_COMMAND $FILE_LOCK         $TOUCH_COMMAND $FILE_LOCK
 else else
-        ​log "Check if script is NOT already runnig ​.....................[FAILED]"+        ​logline ​"Check if the script is NOT already runnig " ​false
         log ""​         log ""​
         log "​ERROR:​ The script was already running, or LOCK file already exists!"​         log "​ERROR:​ The script was already running, or LOCK file already exists!"​
         log ""​         log ""​
-        sendmail ERROR + error 20
-        movelog +
-        exit 30+
 fi fi
  
 # Check if DIR_BACKUP Directory NOT exists. # Check if DIR_BACKUP Directory NOT exists.
 if [ ! -d "​$DIR_BACKUP"​ ]; then if [ ! -d "​$DIR_BACKUP"​ ]; then
-        ​log "Check if DIR_BACKUP exists.................................[FAILED]+        ​logline ​"Check if DIR_BACKUP exists " ​false 
-        $MKDIR_COMMAND -p $DIR_BACKUP + $MKDIR_COMMAND -p $DIR_BACKUP 
-        ​log "​DIR_BACKUP was now created.................................[ ​ OK  ]"+        ​logline ​"​DIR_BACKUP was now created " ​true
 else else
-        ​log "Check if DIR_BACKUP exists................................. ​OK ​ ]"+        ​logline ​"Check if DIR_BACKUP exists ​" true 
 +fi 
 + 
 +# Check if FILE_USERLIST NOT set OR IS empty. 
 +log ""​ 
 +if [ ! -n "​$FILE_USERLIST" ​ ]; then 
 +        log "Check if the variable FILE_USERLIST is set ................[  NO  ]" 
 +        log "​Mailboxes to backup will be determined by doveadm user \"​*\"​.
 + 
 + for users in `doveadm user "​*"​`;​ do 
 + VAR_LISTED_USER+=($users);​ 
 + done 
 +else 
 +        logline "Check if the variable FILE_USERLIST is set " true 
 +        log "​Mailboxes to backup will be read from file.
 +        log ""​ 
 +        log "- File: [$FILE_USERLIST]"​ 
 + 
 + # Check if file exists. 
 + if [ -f "​$FILE_USERLIST"​ ]; then 
 +        logline "- Check if FILE_USERLIST exists " true 
 + else 
 +        logline "- Check if FILE_USERLIST exists " false 
 +        log ""​ 
 + error 30 
 + fi 
 + 
 + # Check if file is readable. 
 + if [ -r "​$FILE_USERLIST"​ ]; then 
 +        logline "- Check if FILE_USERLIST is readable " true 
 + else 
 +        logline "- Check if FILE_USERLIST is readable " false 
 +        log ""​ 
 + error 31 
 + fi 
 + 
 + # Read file into variable. 
 + while IFS= read -r line 
 + do  
 + # Check for valid e-mail address. 
 + if [ $FILE_USERLIST_VALIDATE_EMAIL = '​Y'​ ]; then 
 + # Check if basic email address syntax is valid. 
 + if echo "​${line}"​ | $GREP_COMMAND '​^[a-zA-Z0-9]*@[a-zA-Z0-9]*\.[a-zA-Z0-9]*$'​ >/​dev/​null;​ then 
 + VAR_LISTED_USER+=($line);​ 
 + else 
 +        log ""​ 
 +         log "​ERROR:​ The user: $line is NOT valid e-mail address!"​ 
 + 
 +                 ((VAR_COUNT_FAIL++)) 
 +                 VAR_FAILED_USER+=($line);​ 
 + fi 
 + else 
 + VAR_LISTED_USER+=($line);​ 
 + fi 
 + done <"​$FILE_USERLIST"​ 
 + 
 + # Check if VAR_COUNT_FAIL is greater than zeroIf YES, set VAR_COUNT_USER to VAR_COUNT_FAIL. 
 + if [ "$VAR_COUNT_FAIL"​ -ne "​0"​ ]; then 
 + VAR_COUNT_USER=$VAR_COUNT_FAIL 
 + fi
 fi fi
  
 # Start backup. # Start backup.
 log ""​ log ""​
-log "+-----------------------------------------------------------------+"​ +headerblock ​"Run backup $SCRIPT_NAME "
-log "​| ​Run backup $SCRIPT_NAME ​..................................... |" +
-log "​+-----------------------------------------------------------------+"+
 log ""​ log ""​
  
 # Start real backup process for all users. # Start real backup process for all users.
-for users in `doveadm user "*"`; do +for users in "${VAR_LISTED_USER[@]}"; do 
-        log "Start backup process for user: $users ..."+ log "Start backup process for user: $users ..."
  
-        ​((VAR_COUNT_USER++)) + ((VAR_COUNT_USER++)) 
-        DOMAINPART=${users#​*@} + DOMAINPART=${users#​*@} 
-        LOCALPART=${users%%@*} + LOCALPART=${users%%@*} 
-        LOCATION="​$DIR_BACKUP/​$DOMAINPART/​$LOCALPART/​$MAILDIR_NAME"​ + LOCATION="​$DIR_BACKUP/​$DOMAINPART/​$LOCALPART/​$MAILDIR_NAME"​ 
-        USERPART="​$DOMAINPART/​$LOCALPART"​+ USERPART="​$DOMAINPART/​$LOCALPART"​
  
-        ​log "​Extract mailbox data for user: $users ..." + log "​Extract mailbox data for user: $users ..." 
-        $DSYNC_COMMAND -o plugin/​quota= -f -u $users backup $MAILDIR_TYPE:​$LOCATION+ $DSYNC_COMMAND -o plugin/​quota= -f -u $users backup $MAILDIR_TYPE:​$LOCATION
  
-        ​# Check the status of dsync and continue the script depending on the result. + # Check the status of dsync and continue the script depending on the result. 
-        if [ "​$?"​ != "​0"​ ]; then + if [ "​$?"​ != "​0"​ ]; then 
-                case "​$?"​ in + case "​$?"​ in 
-                1)      log "​Synchronization failed > user: $users !!!" + 1) log "​Synchronization failed > user: $users !!!" 
-                        ;; + ;; 
-                2)      log "​Synchronization was done without errors, but some changes couldn'​t be done, so the mailboxes aren't perfectly synchronized for user: $users !!!" + 2) log "​Synchronization was done without errors, but some changes couldn'​t be done, so the mailboxes aren't perfectly synchronized for user: $users !!!" 
-                        ;; + ;; 
-                esac + esac 
-                if [ "​$?"​ -gt "​3"​ ]; then + if [ "​$?"​ -gt "​3"​ ]; then 
-                        log "​Synchronization failed > user: $users !!!" + log "​Synchronization failed > user: $users !!!" 
-                fi+ fi
  
-                ​((VAR_COUNT_FAIL++)) + ((VAR_COUNT_FAIL++)) 
-                VAR_FAILED_USER+=($users);​ + VAR_FAILED_USER+=($users);​ 
-        else + else 
-                log "​Synchronization done for user: $users ..."+         log "​Synchronization done for user: $users ..."
  
-                ​cd $DIR_BACKUP+ cd $DIR_BACKUP
  
-                ​log "​Packaging to archive for user: $users ..." + log "​Packaging to archive for user: $users ..." 
-                $TAR_COMMAND -cvzf $users-$FILE_BACKUP $USERPART --atime-preserve --preserve-permissions+ $TAR_COMMAND -cvzf $users-$FILE_BACKUP $USERPART --atime-preserve --preserve-permissions
  
-                ​log "​Delete archive files for user: $users ..." + log "​Delete archive files for user: $users ..." 
-                (ls $users-$FILE_DELETE ​-t|head -n $BACKUPFILES_DELETE;​ls $users-$FILE_DELETE )|sort|uniq -u|xargs -r rm + (ls -t $users-$FILE_DELETE|head -n $BACKUPFILES_DELETE;​ls $users-$FILE_DELETE)|sort|uniq -u|xargs -r rm 
-                if [ "​$?"​ != "​0"​ ]; then + if [ "​$?"​ != "​0"​ ]; then 
-                        ​log ​"​Delete old archive files $DIR_BACKUP ​.....................[FAILED]+        ​ logline ​"​Delete old archive files $DIR_BACKUP " ​false 
-                else + else 
-                        ​log ​"​Delete old archive files $DIR_BACKUP ​.....................[ ​ OK  ]+        ​ logline ​"​Delete old archive files $DIR_BACKUP " ​true 
-                fi+ fi
  
-                ​log "​Delete mailbox files for user: $users ..." + log "​Delete mailbox files for user: $users ..." 
-                $RM_COMMAND "​$DIR_BACKUP/​$DOMAINPART"​ -rf + $RM_COMMAND "​$DIR_BACKUP/​$DOMAINPART"​ -rf 
-                if [ "​$?"​ != "​0"​ ]; then + if [ "​$?"​ != "​0"​ ]; then 
-                        ​log ​"​Delete mailbox files at: $DIR_BACKUP ​.....................[FAILED]+        ​ logline ​"​Delete mailbox files at: $DIR_BACKUP " ​false 
-                else + else 
-                        ​log ​"​Delete mailbox files at: $DIR_BACKUP ​.....................[ ​ OK  ]+        ​ logline ​"​Delete mailbox files at: $DIR_BACKUP " ​true 
-                fi + fi 
-        fi+ fi
  
-        ​log "Ended backup process for user: $users ..."+ log "Ended backup process for user: $users ..."
         log ""​         log ""​
 done done
Zeile 487: Zeile 575:
         log ""​         log ""​
         $RM_COMMAND -f $FILE_LOCK         $RM_COMMAND -f $FILE_LOCK
-        sendmail ERROR + error ​99
-        movelog +
-        exit 99+
 else else
-        log "+ headerblock ​"End backup $SCRIPT_NAME "
-        log "​+-----------------------------------------------------------------+"​ +
-        log "​| ​End backup $SCRIPT_NAME ​..................................... |" +
-        log "​+-----------------------------------------------------------------+"+
         log ""​         log ""​
 fi fi
  
 # Finish syncing with runntime statistics. # Finish syncing with runntime statistics.
-log "+-----------------------------------------------------------------+"​ +headerblock ​"Runtime ​statistics "
-log "| Runntime ​statistics............................................ |" +
-log "​+-----------------------------------------------------------------+"+
 log ""​ log ""​
 log "- Number of determined users: $VAR_COUNT_USER"​ log "- Number of determined users: $VAR_COUNT_USER"​
Zeile 507: Zeile 588:
  
 if [ "​$VAR_COUNT_FAIL"​ -gt "​0"​ ]; then if [ "​$VAR_COUNT_FAIL"​ -gt "​0"​ ]; then
-        ​log "- ...Mailbox of failed users: " + log "- ...Mailbox of failed users: " 
-        for i in "​${VAR_FAILED_USER[@]}"​ + for i in "​${VAR_FAILED_USER[@]}"​ 
-        do + do 
-                log "- ... $i" + log "- ... $i" 
-        done+ done
 fi fi
  
 log ""​ log ""​
-log "+-----------------------------------------------------------------+"​ +END_TIMESTAMP=`$DATE_COMMAND '​+%s'​` 
-log "| Finish......................................................... |+log "Runtime: `$DATE_COMMAND ​--d "0 $END_TIMESTAMP seconds ​$RUN_TIMESTAMP seconds" ​+'​%H:​%M:​%S'​` time elapsed.
-log "+-----------------------------------------------------------------+"+log ""​ 
 +headerblock ​"Finished creating the backups [`$DATE_COMMAND '+%a, %d %b %Y %H:%M:%S (%Z)'​`]"
 log ""​ log ""​
  
-# If errors ​occured ​on user backups, exit with return code 1 instead of 0.+# If errors ​occurred ​on user backups, exit with return code 1 instead of 0.
 if [ "​$VAR_COUNT_FAIL"​ -gt "​0"​ ]; then if [ "​$VAR_COUNT_FAIL"​ -gt "​0"​ ]; then
         sendmail ERROR         sendmail ERROR
-        ​movelog + movelog 
-        exit 1+ exit 1
 else else
-        ​# Status e-mail. + # Status e-mail. 
-        if [ $MAIL_STATUS = '​Y'​ ]; then + if [ $MAIL_STATUS = '​Y'​ ]; then 
-                sendmail STATUS +         sendmail STATUS 
-        fi + fi 
-        movelog + movelog 
-        exit 0+ exit 0
 fi fi
 +</​code>​
 +
 +==== Beispieldatei:​ FILE_USERLIST ====
 +
 +Nachfolgend eine Beispiel für den Inhalt einer Datei, welche unter der Variable:
 +<code bash>
 +# CUSTOM - Path and file name of a file with e-mail addresses to backup, if
 +#          SET. If NOT, the script will determine all mailboxes by default.
 +# FILE_USERLIST='/​path/​and/​file/​name/​of/​user/​list/​with/​one/​email/​per/​line'​
 +# - OR -
 +# FILE_USERLIST=''​
 +FILE_USERLIST='/​srv/​dovecot_backup.userlist'​
 +</​code>​
 +definiert werden kann:
 +
 +<​code>​
 +klaus@tachtler.net
 +petra@tachtler.net
 +</​code>​
 +**__oder__**
 +
 +<​code>​
 +klaus
 +petra
 </​code>​ </​code>​
  
Zeile 540: Zeile 646:
   * ''/​var/​log/''​ - hier z.B. ''/​var/​log/​dovecot_backup.log''​   * ''/​var/​log/''​ - hier z.B. ''/​var/​log/​dovecot_backup.log''​
  
 +**__OHNE__ ''​FILE_USERLIST'':​**
 +<​code>​
 +2019/01/30 14:​24:​28 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​24:​28 ​ INFO: | Start backup of the mailboxes [Wed, 30 Jan 2019 14:24:28 (CET)] |
 +2019/01/30 14:​24:​28 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: SCRIPT_NAME.................:​ dovecot_backup
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: DIR_BACKUP..................:​ /srv/backup
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: MAIL_RECIPIENT..............:​ you@example.com
 +2019/01/30 14:​24:​28 ​ INFO: MAIL_STATUS.................:​ N
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: FILE_USERLIST...............: ​
 +2019/01/30 14:​24:​28 ​ INFO: FILE_USERLIST_VALIDATE_EMAIL:​ N
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​dsync'​ was found....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​tar'​ was found......................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​touch'​ was found....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​rm'​ was found.......................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​cat'​ was found......................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​date'​ was found.....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​mkdir'​ was found....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​chown'​ was found....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​chmod'​ was found....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​bin/​grep'​ was found.....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if command '/​sbin/​sendmail'​ was found................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if script is NOT already runnig .....................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO: Check if DIR_BACKUP exists.................................[ OK ]
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: Check if the variable FILE_USERLIST is set.................[ NO ]
 +2019/01/30 14:​24:​28 ​ INFO: Mailboxes to backup will be determined by doveadm user "​*"​.
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​28 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​24:​28 ​ INFO: | Run backup dovecot_backup ..................................... |
 +2019/01/30 14:​24:​28 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​24:​28 ​ INFO:
 +2019/01/30 14:​24:​29 ​ INFO: Start backup process for user: klaus@tachtler.net ...
 +2019/01/30 14:​24:​29 ​ INFO: Extract mailbox data for user: klaus@tachtler.net ...
 +2019/01/30 14:​27:​43 ​ INFO: Synchronization done for user: klaus@tachtler.net ...
 +2019/01/30 14:​27:​43 ​ INFO: Packaging to archive for user: klaus@tachtler.net ...
 +2019/01/30 14:​27:​48 ​ INFO: Delete archive files for user: klaus@tachtler.net ...
 +2019/01/30 14:​27:​48 ​ INFO: Delete old archive files /srv/backup .....................[ OK ]
 +2019/01/30 14:​27:​48 ​ INFO: Delete mailbox files for user: klaus@tachtler.net ...
 +2019/01/30 14:​27:​48 ​ INFO: Delete mailbox files at: /srv/backup .....................[ OK ]
 +2019/01/30 14:​27:​48 ​ INFO: Ended backup process for user: klaus@tachtler.net ...
 +2019/01/30 14:​27:​48 ​ INFO:
 +2019/01/30 14:​27:​48 ​ INFO: Start backup process for user: petra@tachtler.net ...
 +2019/01/30 14:​27:​48 ​ INFO: Extract mailbox data for user: petra@tachtler.net ...
 +2019/01/30 14:​27:​56 ​ INFO: Synchronization done for user: petra@tachtler.net ...
 +2019/01/30 14:​27:​56 ​ INFO: Packaging to archive for user: petra@tachtler.net ...
 +2019/01/30 14:​27:​57 ​ INFO: Delete archive files for user: petra@tachtler.net ...
 +2019/01/30 14:​27:​57 ​ INFO: Delete old archive files /srv/backup .....................[ OK ]
 +2019/01/30 14:​27:​57 ​ INFO: Delete mailbox files for user: petra@tachtler.net ...
 +2019/01/30 14:​27:​57 ​ INFO: Delete mailbox files at: /srv/backup .....................[ OK ]
 +2019/01/30 14:​27:​57 ​ INFO: Ended backup process for user: petra@tachtler.net ...
 +2019/01/30 14:​28:​01 ​ INFO:
 +2019/01/30 14:​28:​01 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​28:​01 ​ INFO: | End backup dovecot_backup ..................................... |
 +2019/01/30 14:​28:​01 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​28:​01 ​ INFO:
 +2019/01/30 14:​28:​01 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​28:​01 ​ INFO: | Runtime statistics............................................. |
 +2019/01/30 14:​28:​01 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​28:​01 ​ INFO:
 +2019/01/30 14:​28:​01 ​ INFO: - Number of determined users: 2
 +2019/01/30 14:​28:​01 ​ INFO: - ...Summary of failed users: 0
 +2019/01/30 14:​28:​01 ​ INFO:
 +2019/01/30 14:​28:​01 ​ INFO: Runtime: 00:03:33 time elapsed.
 +2019/01/30 14:​28:​01 ​ INFO:
 +2019/01/30 14:​28:​01 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​28:​01 ​ INFO: | Finished creating the backups [Wed, 30 Jan 2019 14:28:01 (CET)] |
 +2019/01/30 14:​28:​01 ​ INFO: +-----------------------------------------------------------------+
 +2019/01/30 14:​28:​01 ​ INFO:
 +</​code>​
 +
 +**__MIT__ ''​FILE_USERLIST'':​**
 <​code>​ <​code>​
-2017/01/11 15:​28:​38 ​ INFO: +2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ 
-2017/​01/​11 ​15:28:38  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:51  INFO: | Start backup ​of the mailboxes ​[Wed, 30 Jan 2019 15:07:51 (CET)] ​
-2017/01/11 15:28:38  INFO: | Start backup the mailboxes ​of dovecot server................... ​+2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ 
-2017/01/11 15:28:38  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:07:51  ​INFO: ​SCRIPT_NAME.................dovecot_backup 
-2017/01/11 15:28:38  ​INFO: ​Run script with following parameter+2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:07:51  ​INFO: ​DIR_BACKUP..................: /srv/backup 
-2017/01/11 15:28:38  ​INFO: ​SCRIPT_NAME...: dovecot_backup +2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:07:51  ​INFO: ​MAIL_RECIPIENT..............: you@example.com 
-2017/01/11 15:28:38  ​INFO: ​DIR_BACKUP....: /srv/backup +2019/01/30 15:​07:​51 ​ INFO: MAIL_STATUS.................:​ N 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:28:38  ​INFO: ​MAIL_RECIPIENTroot@tachtler.net +2019/01/30 15:07:51  ​INFO: ​FILE_USERLIST.............../​srv/​dovecot_backup.userlist 
-2017/01/11 15:28:38  ​INFO: ​MAIL_STATUS...N +2019/01/30 15:07:51  ​INFO: ​FILE_USERLIST_VALIDATE_EMAILY 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​dsync'​ was found....................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​dsync'​ was found....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​tar'​ was found......................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​tar'​ was found......................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​touch'​ was found....................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​touch'​ was found....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​rm'​ was found.......................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​rm'​ was found.......................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​cat'​ was found......................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​cat'​ was found......................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​date'​ was found.....................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​date'​ was found.....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​mkdir'​ was found....................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​mkdir'​ was found....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​chown'​ was found....................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​chown'​ was found....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​bin/​chmod'​ was found....................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​chmod'​ was found....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if command '/​sbin/​sendmail'​ was found................[ OK ] +2019/01/30 15:07:51  INFO: Check if command '/​bin/​grep'​ was found.....................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if script is NOT already runnig .....................[ OK ] +2019/01/30 15:​07:​51 ​ INFO: Check if command '/​sbin/​sendmail'​ was found................[ OK ] 
-2017/01/11 15:28:38  INFO: Check if DIR_BACKUP exists.................................[ OK ] +2019/01/30 15:07:51  INFO: Check if script is NOT already runnig .....................[ OK ] 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:07:51  INFO: Check if DIR_BACKUP exists.................................[ OK ] 
-2017/01/11 15:28:38  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:28:38  INFO: | Run backup dovecot_backup ..................................... | +2019/01/30 15:​07:​51 ​ INFO: Check if the variable FILE_USERLIST is set.................[ OK ] 
-2017/01/11 15:28:38  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:​07:​51 ​ INFO: Mailboxes to backup will read from file. 
-2017/01/11 15:28:38  ​INFO:​ +2019/01/30 15:​07:​51 ​ INFO: 
-2017/01/11 15:28:39  INFO: Start backup process for user: klaus@tachtler.net ... +2019/01/30 15:​07:​51 ​ INFO: - File: [/​home/​klaus/​dovecot_backup.userlist] 
-2017/01/11 15:28:39  INFO: Extract mailbox data for user: klaus@tachtler.net ... +2019/01/30 15:​07:​51 ​ INFO: - Check if FILE_USERLIST exists............................[ OK ] 
-2017/01/11 15:29:46  INFO: Packaging to archive for user: klaus@tachtler.net ... +2019/01/30 15:​07:​51 ​ INFO: - Check if FILE_USERLIST is readable.......................[ OK ] 
-2017/01/11 15:29:49  INFO: Delete archive files for user: klaus@tachtler.net ... +2019/01/30 15:​07:​51 ​ INFO: 
-2017/01/11 15:29:49  INFO: Delete old archive files /srv/backup ...................[FAILED+2019/01/30 15:​07:​51 ​ INFO: ERROR: The user: notvaild_email.net is NOT valid e-mail address! 
-2017/01/11 15:29:49  INFO: Delete mailbox files for user: klaus@tachtler.net ... +2019/01/30 15:​07:​51 ​ INFO: 
-2017/01/11 15:29:49  INFO: Delete mailbox files at: /srv/backup ...................[ OK ] +2019/​01/​30 ​15:07:51  INFO: +-----------------------------------------------------------------+ 
-2017/01/11 15:29:49  INFO: Ended backup process for user: klaus@tachtler.net ... +2019/01/30 15:07:51  INFO: | Run backup dovecot_backup ..................................... | 
-2017/01/11 15:29:49  ​INFO:​ +2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ 
-2017/01/11 15:29:49  INFO: Start backup process for user: petra@tachtler.net ... +2019/01/30 15:07:51  ​INFO:​ 
-2017/01/11 15:29:49  INFO: Extract mailbox data for user: petra@tachtler.net ... +2019/01/30 15:07:51  INFO: Start backup process for user: klaus@tachtler.net ... 
-2017/01/11 15:29:58  INFO: Packaging to archive for user: petra@tachtler.net ... +2019/01/30 15:07:51  INFO: Extract mailbox data for user: klaus@tachtler.net ... 
-2017/01/11 15:30:00  INFO: Delete archive files for user: petra@tachtler.net ... +2019/01/30 15:​07:​54 ​ INFO: Synchronization done for user: klaus@tachtler.net ... 
-2017/01/11 15:30:00  INFO: Delete old archive files /srv/backup ...................[FAILED+2019/​01/​30 ​15:07:54  INFO: Packaging to archive for user: klaus@tachtler.net ... 
-2017/01/11 15:30:00  INFO: Delete mailbox files for user: petra@tachtler.net ... +2019/01/30 15:07:54  INFO: Delete archive files for user: klaus@tachtler.net ... 
-2017/01/11 15:30:00  INFO: Delete mailbox files at: /srv/backup ...................[ OK ] +2019/01/30 15:07:54  INFO: Delete old archive files /​srv/​backup ​.....................[ ​OK 
-2017/01/11 15:30:00  INFO: Ended backup process for user: petra@tachtler.net ... +2019/01/30 15:07:54  INFO: Delete mailbox files for user: klaus@tachtler.net ... 
-2017/01/11 15:30:02  ​INFO:​ +2019/01/30 15:07:54  INFO: Delete mailbox files at: /​srv/​backup ​.....................[ OK ] 
-2017/01/11 15:30:02  INFO: +2019/01/30 15:07:54  INFO: Ended backup process for user: klaus@tachtler.net ... 
-2017/​01/​11 ​15:30:02  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:54  ​INFO:​ 
-2017/01/11 15:30:02  INFO: | End backup dovecot_backup ..................................... | +2019/01/30 15:07:54  INFO: Start backup process for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:54  INFO: Extract mailbox data for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  ​INFO:​ +2019/01/30 15:​07:​56 ​ INFO: Synchronization done for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  INFO: +-----------------------------------------------------------------+ +2019/​01/​30 ​15:07:56  INFO: Packaging to archive for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  INFO: | Runntime ​statistics............................................ | +2019/01/30 15:07:56  INFO: Delete archive files for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:56  INFO: Delete old archive files /​srv/​backup ​.....................[ ​OK 
-2017/01/11 15:30:02  ​INFO:​ +2019/01/30 15:07:56  INFO: Delete mailbox files for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  INFO: - Number of determined users: ​2 +2019/01/30 15:07:56  INFO: Delete mailbox files at: /​srv/​backup ​.....................[ OK ] 
-2017/01/11 15:30:02  INFO: - ...Summary of failed users: ​0 +2019/01/30 15:07:56  INFO: Ended backup process for user: petra@tachtler.net ... 
-2017/01/11 15:30:02  ​INFO:​ +2019/01/30 15:07:56  ​INFO:​ 
-2017/01/11 15:30:02  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ 
-2017/01/11 15:30:02  INFO: | Finish......................................................... ​+2019/01/30 15:07:56  INFO: | End backup dovecot_backup ..................................... | 
-2017/01/11 15:30:02  INFO: +-----------------------------------------------------------------+ +2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ 
-2017/01/11 15:30:02  INFO:+2019/01/30 15:07:56  ​INFO:​ 
 +2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ 
 +2019/01/30 15:07:56  INFO: | Runtime ​statistics............................................. | 
 +2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ 
 +2019/01/30 15:07:56  ​INFO:​ 
 +2019/01/30 15:07:56  INFO: - Number of determined users: ​3 
 +2019/01/30 15:07:56  INFO: - ...Summary of failed users: ​1 
 +2019/01/30 15:07:56  INFO: - ...Mailbox of failed users: 
 +2019/01/30 15:07:56  ​INFO: ​- ... notvaild_email.net 
 +2019/01/30 15:07:56  INFO: 
 +2019/01/30 15:​07:​56 ​ INFO: Runtime: 00:00:05 time elapsed. 
 +2019/01/30 15:​07:​56 ​ INFO: 
 +2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ 
 +2019/01/30 15:07:56  INFO: | Finished creating the backups [Wed, 30 Jan 2019 15:07:56 (CET)] ​
 +2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ 
 +2019/01/30 15:07:56  INFO:
 </​code>​ </​code>​
  
tachtler/dovecot_backup_-_skript.1533539335.txt.gz · Zuletzt geändert: 2018/08/06 09:08 von klaus