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 [2019/10/07 16:35]
klaus [Backup]
tachtler:dovecot_backup_-_skript [2019/10/16 15:07] (aktuell)
klaus [Skript - Log]
Zeile 46: Zeile 46:
  
 # CUSTOM - Backup-Files. # CUSTOM - Backup-Files.
 +TMP_FOLDER='/​srv/​backup'​
 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
Zeile 82: Zeile 83:
 ^ Parametername ​         ^ Beschreibung ​                                                                           ^ ^ Parametername ​         ^ Beschreibung ​                                                                           ^
 | ''​SCRIPT_NAME'' ​       | Name des Skriptes ​                                                                      | | ''​SCRIPT_NAME'' ​       | Name des Skriptes ​                                                                      |
 +| ''​TMP_FOLDER'' ​        | Verzeichnis in dem ein temporärer Ordner erstellt werden soll, um die Backup-Dateien temporär zu extrahiert, damit diese dann abschließend in ein Archivformat (tar.gz) zu packen ​                           |
 | ''​DIR_BACKUP'' ​        | Verzeichnis in dem die Backup-Dateien abgelegt werden sollen ​                           | | ''​DIR_BACKUP'' ​        | Verzeichnis in dem die Backup-Dateien abgelegt werden sollen ​                           |
 | ''​FILE_BACKUP'' ​       | **Allgemeiner Teil** der Bezeichnung für die Backup-Dateien ​                            | | ''​FILE_BACKUP'' ​       | **Allgemeiner Teil** der Bezeichnung für die Backup-Dateien ​                            |
Zeile 126: Zeile 128:
 #               will be send by e-mail. ​                                     # #               will be send by e-mail. ​                                     #
 #                                                                            # #                                                                            #
-# Last update : 31.01.2019                                                   # +# Last update : 08.10.2019                                                   # 
-# Version ​    : 1.10                                                         #+# Version ​    : 1.11                                                         #
 #                                                                            # #                                                                            #
 # Author ​     : Klaus Tachtler, <​klaus@tachtler.net> ​                        # # Author ​     : Klaus Tachtler, <​klaus@tachtler.net> ​                        #
Zeile 207: Zeile 209:
 # Version ​    : 1.10                                                         # # Version ​    : 1.10                                                         #
 # Description : Code redesign. ​                                              # # Description : Code redesign. ​                                              #
 +# -------------------------------------------------------------------------- #
 +# Version ​    : 1.11                                                         #
 +# Description : GitHub Issue #12                                             #
 +#               ​Change of the temporary storage medium from DIR_BACKUP to    #
 +#               ​TMP_FOLDER for temporary storage of extracted emails from    #
 +#               the mailboxes was introduced. This allows the use of a       #
 +#               ​temporary storage of the extracted emails from the mailboxes #
 +#               on a faster storage medium, or also on a local storage ​      #
 +#               ​medium,​ which avoids rights problems if DIR_BACKUP is e.g.   #
 +#               an NFS mounted storage. ​                                     #
 +#               ​Thanks to Krisztián Hamar. ​                                  #
 # -------------------------------------------------------------------------- # # -------------------------------------------------------------------------- #
 # Version ​    : x.xx                                                         # # Version ​    : x.xx                                                         #
Zeile 221: Zeile 234:
  
 # CUSTOM - Backup-Files. # CUSTOM - Backup-Files.
 +TMP_FOLDER='/​srv/​backup'​
 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
Zeile 264: Zeile 278:
 CHOWN_COMMAND=`command -v chown` CHOWN_COMMAND=`command -v chown`
 CHMOD_COMMAND=`command -v chmod` CHMOD_COMMAND=`command -v chmod`
 +MKTEMP_COMMAND=`command -v mktemp`
 GREP_COMMAND=`command -v grep` GREP_COMMAND=`command -v grep`
 +MV_COMMAND=`which --skip-alias mv`
 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 401: Zeile 417:
 log "​SCRIPT_NAME.................:​ $SCRIPT_NAME"​ log "​SCRIPT_NAME.................:​ $SCRIPT_NAME"​
 log ""​ log ""​
 +log "​TMP_FOLDER..................:​ $TMP_FOLDER"​
 log "​DIR_BACKUP..................:​ $DIR_BACKUP"​ log "​DIR_BACKUP..................:​ $DIR_BACKUP"​
 log ""​ log ""​
Zeile 421: Zeile 438:
 checkcommand $CHMOD_COMMAND checkcommand $CHMOD_COMMAND
 checkcommand $GREP_COMMAND checkcommand $GREP_COMMAND
 +checkcommand $MKTEMP_COMMAND
 +checkcommand $MV_COMMAND
 checkcommand $PROG_SENDMAIL checkcommand $PROG_SENDMAIL
  
Zeile 436: Zeile 455:
 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
         logline "Check if DIR_BACKUP exists " false         logline "Check if DIR_BACKUP exists " false
  $MKDIR_COMMAND -p $DIR_BACKUP  $MKDIR_COMMAND -p $DIR_BACKUP
-        ​logline "​DIR_BACKUP was now created " true+ if [ "​$?"​ != "​0"​ ]; then 
 +        logline "​DIR_BACKUP was NOT created " false 
 + error 21 
 + else 
 +        logline "​DIR_BACKUP was now created " true 
 + fi
 else else
         logline "Check if DIR_BACKUP exists " true         logline "Check if DIR_BACKUP exists " true
Zeile 508: Zeile 532:
 headerblock "Run backup $SCRIPT_NAME " headerblock "Run backup $SCRIPT_NAME "
 log ""​ log ""​
 +
 +# Check if TMP_FOLDER directory path NOT exists, else create it.
 +if [ ! -d "​$TMP_FOLDER"​ ]; then
 +        logline "Check if TMP_FOLDER exists " false
 + $MKDIR_COMMAND -p $TMP_FOLDER
 + if [ "​$?"​ != "​0"​ ]; then
 + logline "​Create temporary '​$TMP_FOLDER'​ folder " false
 + error 40
 + else
 + logline "​Create temporary '​$TMP_FOLDER'​ folder " true
 + fi
 +else
 +        logline "Check if TMP_FOLDER exists " true
 +fi
 +
 +# Make temporary directory DIR_TEMP inside TMP_FOLDER.
 +DIR_TEMP=$($MKTEMP_COMMAND -d -p $TMP_FOLDER -t $SCRIPT_NAME-XXXXXXXXXXXX)
 +if [ "​$?"​ != "​0"​ ]; then
 + logline "​Create temporary '​$DIR_TEMP'​ folder " false
 + error 41
 +else
 + logline "​Create temporary '​$DIR_TEMP'​ folder " true
 + log ""​
 +fi
 +
 +# Set rights permissions to DIR_TEMP.
 +$CHOWN_COMMAND -R $MAILDIR_USER:​$MAILDIR_GROUP $DIR_TEMP
  
 # Start real backup process for all users. # Start real backup process for all users.
Zeile 516: Zeile 567:
  DOMAINPART=${users#​*@}  DOMAINPART=${users#​*@}
  LOCALPART=${users%%@*}  LOCALPART=${users%%@*}
- LOCATION="​$DIR_BACKUP/​$DOMAINPART/​$LOCALPART/​$MAILDIR_NAME"​+ LOCATION="​$DIR_TEMP/​$DOMAINPART/​$LOCALPART/​$MAILDIR_NAME"​
  USERPART="​$DOMAINPART/​$LOCALPART"​  USERPART="​$DOMAINPART/​$LOCALPART"​
  
Zeile 539: Zeile 590:
         log "​Synchronization done for user: $users ..."         log "​Synchronization done for user: $users ..."
  
- cd $DIR_BACKUP+ cd $DIR_TEMP
  
  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 ​mailbox ​files for user: $users ..." 
- (ls -t $users-$FILE_DELETE|head -n $BACKUPFILES_DELETE;​ls $users-$FILE_DELETE)|sort|uniq -u|xargs ​-r rm+ $RM_COMMAND "$DIR_TEMP/$DOMAINPART" ​-rf
  if [ "​$?"​ != "​0"​ ]; then  if [ "​$?"​ != "​0"​ ]; then
-        logline "​Delete ​old archive ​files $DIR_BACKUP ​" false+        logline "​Delete ​mailbox ​files at: $DIR_TEMP ​" false
  else  else
-        logline "​Delete ​old archive ​files $DIR_BACKUP ​" true+        logline "​Delete ​mailbox ​files at: $DIR_TEMP ​" true
  fi  fi
  
- log "Delete mailbox files for user: $users ..." + log "Copying archive file for user: $users ..." 
- $RM_COMMAND ​"$DIR_BACKUP/$DOMAINPART" ​-rf+ $MV_COMMAND ​"$DIR_TEMP/$users-$FILE_BACKUP"​ "​$DIR_BACKUP"​
  if [ "​$?"​ != "​0"​ ]; then  if [ "​$?"​ != "​0"​ ]; then
-        logline "Delete mailbox files at: $DIR_BACKUP " false+        logline "Move archive file for user to: $DIR_BACKUP " false
  else  else
-        logline "​Delete ​mailbox ​files at: $DIR_BACKUP " true+        logline ​"Move archive file for user to: $DIR_BACKUP " true 
 + fi 
 + 
 + cd $DIR_BACKUP 
 + 
 + log "​Delete ​archive ​files for user: $users ..." 
 + (ls -t $users-$FILE_DELETE|head -n $BACKUPFILES_DELETE;​ls $users-$FILE_DELETE)|sort|uniq -u|xargs -r rm 
 + if [ "​$?"​ != "​0"​ ]; then 
 +        logline "​Delete old archive files from: $DIR_BACKUP " false 
 + else 
 +        logline "​Delete old archive files from: $DIR_BACKUP " true
  fi  fi
  fi  fi
Zeile 564: Zeile 625:
         log ""​         log ""​
 done done
 +
 +# Delete the temporary folder DIR_TEMP.
 +$RM_COMMAND $DIR_TEMP -rf
 +if [ "​$?"​ != "​0"​ ]; then
 + logline "​Delete temporary '​$DIR_TEMP'​ folder " false
 + error 42
 +else
 + logline "​Delete temporary '​$DIR_TEMP'​ folder " true
 + log ""​
 +fi
  
 # Set owner and rights permissions to backup directory and backup files. # Set owner and rights permissions to backup directory and backup files.
Zeile 648: Zeile 719:
 **__OHNE__ ''​FILE_USERLIST'':​** **__OHNE__ ''​FILE_USERLIST'':​**
 <​code>​ <​code>​
-2019/01/30 14:24:28  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: 
-2019/01/30 14:24:28  INFO: | Start backup of the mailboxes [Wed, 30 Jan 2019 14:24:28 (CET)] | +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:24:28  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: | Start backup of the mailboxes [Wed, 16 Oct 2019 04:00:02 (CEST)] | 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:24:28  INFO: SCRIPT_NAME.................:​ dovecot_backup +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: SCRIPT_NAME.................:​ dovecot_backup 
-2019/01/30 14:24:28  INFO: DIR_BACKUP..................:​ /​srv/​backup +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: TMP_FOLDER..................:​ /​srv/​backup 
-2019/01/30 14:24:28  INFO: MAIL_RECIPIENT..............:​ you@example.com +2019/10/16 04:00:02  INFO: DIR_BACKUP..................:​ /​srv/​backup 
-2019/01/30 14:24:28  INFO: MAIL_STATUS.................:​ N +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: MAIL_RECIPIENT..............:​ you@example.com 
-2019/01/30 14:24:28  INFO: FILE_USERLIST...............:​  +2019/10/16 04:00:02  INFO: MAIL_STATUS.................:​ N 
-2019/01/30 14:24:28  INFO: FILE_USERLIST_VALIDATE_EMAIL:​ N +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: FILE_USERLIST...............:​ 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​dsync'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: FILE_USERLIST_VALIDATE_EMAIL:​ N 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​tar'​ was found......................[ OK ] +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​touch'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​dsync'​ was found ...................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​rm'​ was found.......................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​tar'​ was found .....................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​cat'​ was found......................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​touch'​ was found ...................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​date'​ was found.....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​rm'​ was found ......................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​mkdir'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​cat'​ was found .....................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​chown'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​date'​ was found ....................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​chmod'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​mkdir'​ was found ...................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​bin/​grep'​ was found.....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​chown'​ was found ...................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if command '/​sbin/​sendmail'​ was found................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​chmod'​ was found ...................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if script is NOT already runnig ​.....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​grep'​ was found ....................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if DIR_BACKUP exists.................................[ OK ] +2019/10/16 04:​00:​02 ​ INFO: Check if command '/​bin/​mktemp'​ was found ..................[ OK ] 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: Check if command '/​bin/​mv'​ was found ......................[ OK ] 
-2019/01/30 14:24:28  INFO: Check if the variable FILE_USERLIST is set.................[ NO ] +2019/10/16 04:00:02  INFO: Check if command '/​sbin/​sendmail'​ was found ...............[ OK ] 
-2019/01/30 14:24:28  INFO: Mailboxes to backup will be determined by doveadm user "​*"​. +2019/10/16 04:00:02  INFO: Check if the script is NOT already runnig .................[ OK ] 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: Check if DIR_BACKUP exists ................................[ OK ] 
-2019/01/30 14:24:28  INFO: +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: Check if the variable FILE_USERLIST is set ................[ NO ] 
-2019/01/30 14:24:28  INFO: | Run backup dovecot_backup ..................................... | +2019/10/16 04:00:02  INFO: Mailboxes to backup will be determined by doveadm user "​*"​. 
-2019/01/30 14:24:28  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:24:28  ​INFO:​ +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:24:29  INFO: Start backup process for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: | Run backup dovecot_backup ..................................... | 
-2019/01/30 14:24:29  INFO: Extract mailbox data for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:27:43  INFO: Synchronization done for user: klaus@tachtler.net ... +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 14:27:43  INFO: Packaging to archive for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: Check if TMP_FOLDER exists ................................[ OK ] 
-2019/01/30 14:27:48  INFO: Delete ​archive ​files for user: klaus@tachtler.net ... +2019/10/16 04:​00:​02 ​ INFO: Create temporary '/​srv/​backup/​dovecot_backup-kKnIclhvj92B'​ folder [ OK ] 
-2019/01/30 14:27:48  INFO: Delete ​old archive ​files /srv/backup .....................[ OK ] +2019/10/16 04:​00:​05 ​ INFO: Start backup process for user: klaus@tachtler.net ... 
-2019/01/30 14:27:48  INFO: Delete ​mailbox ​files for user: klaus@tachtler.net ... +2019/10/16 04:00:05  INFO: Extract mailbox data for user: klaus@tachtler.net ... 
-2019/01/30 14:27:48  INFO: Delete ​mailbox ​files at: /​srv/​backup ​.....................[ OK ] +2019/10/16 04:03:32  INFO: Synchronization done for user: klaus@tachtler.net ... 
-2019/01/30 14:27:48  INFO: Ended backup process for user: klaus@tachtler.net ... +2019/10/16 04:03:32  INFO: Packaging to archive for user: klaus@tachtler.net ... 
-2019/01/30 14:27:48  ​INFO:​ +2019/10/16 04:03:37  INFO: Delete ​mailbox ​files for user: klaus@tachtler.net ... 
-2019/01/30 14:27:48  INFO: Start backup process for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Delete ​mailbox ​files at: /srv/backup/​dovecot_backup-kKnIclhvj92B [ OK ] 
-2019/01/30 14:27:48  INFO: Extract mailbox data for user: petra@tachtler.net ... +2019/10/16 04:​03:​37 ​ INFO: Copying archive file for user: klaus@tachtler.net ... 
-2019/01/30 14:27:56  INFO: Synchronization done for user: petra@tachtler.net ... +2019/10/16 04:​03:​37 ​ INFO: Move archive file for user to: /​srv/​backup ​................[ OK ] 
-2019/01/30 14:27:56  INFO: Packaging to archive for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Delete ​archive ​files for user: klaus@tachtler.net ... 
-2019/01/30 14:27:57  INFO: Delete ​archive ​files for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Delete ​old archive ​files from: /srv/backup ................[ OK ] 
-2019/01/30 14:27:57  INFO: Delete ​old archive ​files /srv/backup .....................[ OK ] +2019/10/16 04:03:37  INFO: Ended backup process for user: klaus@tachtler.net ... 
-2019/01/30 14:27:57  INFO: Delete ​mailbox ​files for user: petra@tachtler.net ... +2019/10/16 04:03:37  ​INFO:​ 
-2019/01/30 14:27:57  INFO: Delete ​mailbox ​files at: /​srv/​backup ​.....................[ OK ] +2019/10/16 04:03:37  INFO: Start backup process for user: petra@tachtler.net ... 
-2019/01/30 14:27:57  INFO: Ended backup process for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Extract mailbox data for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  ​INFO:​ +2019/10/16 04:03:45  INFO: Synchronization done for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:45  INFO: Packaging to archive for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  INFO: | End backup dovecot_backup ..................................... | +2019/10/16 04:03:46  INFO: Delete ​mailbox ​files for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:46  INFO: Delete ​mailbox ​files at: /srv/backup/​dovecot_backup-kKnIclhvj92B [ OK ] 
-2019/01/30 14:28:01  ​INFO:​ +2019/10/16 04:​03:​46 ​ INFO: Copying archive file for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:​03:​46 ​ INFO: Move archive file for user to: /​srv/​backup ​................[ OK ] 
-2019/01/30 14:28:01  INFO: | Runtime statistics............................................. | +2019/10/16 04:03:46  INFO: Delete ​archive ​files for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:46  INFO: Delete ​old archive ​files from: /srv/backup ................[ OK ] 
-2019/01/30 14:28:01  ​INFO:​ +2019/10/16 04:03:46  INFO: Ended backup process for user: petra@tachtler.net ... 
-2019/01/30 14:28:01  INFO: - Number of determined users: 2 +2019/10/16 04:03:53  ​INFO:​ 
-2019/01/30 14:28:01  INFO: - ...Summary of failed users: 0 +2019/10/16 04:03:53  INFO: Delete temporary '/​srv/​backup/​dovecot_backup-kKnIclhvj92B'​ folder [ OK ] 
-2019/01/30 14:28:01  ​INFO:​ +2019/10/16 04:​03:​53 ​ INFO: 
-2019/01/30 14:28:01  INFO: Runtime: 00:03:33 time elapsed. +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:28:01  ​INFO:​ +2019/10/16 04:03:53  INFO: | End backup dovecot_backup ..................................... | 
-2019/01/30 14:28:01  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:28:01  INFO: | Finished creating the backups [Wed, 30 Jan 2019 14:28:01 (CET)] | +2019/10/16 04:03:53  ​INFO:​ 
-2019/01/30 14:28:01  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 14:28:01  INFO:+2019/10/16 04:03:53  INFO: | Runtime statistics ............................................ | 
 +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
 +2019/10/16 04:03:53  ​INFO:​ 
 +2019/10/16 04:03:53  INFO: - Number of determined users: 2 
 +2019/10/16 04:03:53  INFO: - ...Summary of failed users: 0 
 +2019/10/16 04:03:53  ​INFO:​ 
 +2019/10/16 04:03:53  INFO: Runtime: 00:03:51 time elapsed. 
 +2019/10/16 04:03:54  ​INFO:​ 
 +2019/10/16 04:03:54  INFO: +-----------------------------------------------------------------+ 
 +2019/10/16 04:03:54  INFO: | Finished creating the backups [Wed, 16 Oct 2019 04:03:54 (CEST)] | 
 +2019/10/16 04:03:54  INFO: +-----------------------------------------------------------------+ 
 +2019/10/16 04:03:54  INFO:
 </​code>​ </​code>​
  
 **__MIT__ ''​FILE_USERLIST'':​** **__MIT__ ''​FILE_USERLIST'':​**
 <​code>​ <​code>​
-2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: 
-2019/01/30 15:07:51  INFO: | Start backup of the mailboxes [Wed, 30 Jan 2019 15:07:51 (CET)] | +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: | Start backup of the mailboxes [Wed, 16 Oct 2019 04:00:02 (CEST)] | 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:51  INFO: SCRIPT_NAME.................:​ dovecot_backup +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: SCRIPT_NAME.................:​ dovecot_backup 
-2019/01/30 15:07:51  INFO: DIR_BACKUP..................:​ /​srv/​backup +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: TMP_FOLDER..................:​ /​srv/​backup 
-2019/01/30 15:07:51  INFO: MAIL_RECIPIENT..............:​ you@example.com +2019/10/16 04:​00:​02 ​ INFO: DIR_BACKUP..................:​ /​srv/​backup 
-2019/01/30 15:07:51  INFO: MAIL_STATUS.................:​ N +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: MAIL_RECIPIENT..............:​ you@example.com 
-2019/01/30 15:07:51  INFO: FILE_USERLIST...............:​ /​srv/​dovecot_backup.userlist +2019/10/16 04:00:02  INFO: MAIL_STATUS.................:​ N 
-2019/01/30 15:07:51  INFO: FILE_USERLIST_VALIDATE_EMAIL:​ Y +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: FILE_USERLIST...............:​ /​srv/​dovecot_backup.userlist 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​dsync'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: FILE_USERLIST_VALIDATE_EMAIL:​ Y 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​tar'​ was found......................[ OK ] +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​touch'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​dsync'​ was found ...................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​rm'​ was found.......................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​tar'​ was found .....................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​cat'​ was found......................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​touch'​ was found ...................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​date'​ was found.....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​rm'​ was found ......................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​mkdir'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​cat'​ was found .....................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​chown'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​date'​ was found ....................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​chmod'​ was found....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​mkdir'​ was found ...................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​bin/​grep'​ was found.....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​chown'​ was found ...................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if command '/​sbin/​sendmail'​ was found................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​chmod'​ was found ...................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if script is NOT already runnig ​.....................[ OK ] +2019/10/16 04:00:02  INFO: Check if command '/​bin/​grep'​ was found ....................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if DIR_BACKUP exists.................................[ OK ] +2019/10/16 04:​00:​02 ​ INFO: Check if command '/​bin/​mktemp'​ was found ..................[ OK ] 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: Check if command '/​bin/​mv'​ was found ......................[ OK ] 
-2019/01/30 15:07:51  INFO: Check if the variable FILE_USERLIST is set.................[ OK ] +2019/10/16 04:​00:​02 ​ INFO: Check if command '/​sbin/​sendmail'​ was found ...............[ OK ] 
-2019/01/30 15:07:51  INFO: Mailboxes to backup will read from file. +2019/10/16 04:00:02  INFO: Check if the script is NOT already runnig .................[ OK ] 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: Check if DIR_BACKUP exists ................................[ OK ] 
-2019/01/30 15:07:51  INFO: - File: [/​home/​klaus/​dovecot_backup.userlist] +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  INFO: - Check if FILE_USERLIST exists............................[ OK ] +2019/10/16 04:00:02  INFO: Check if the variable FILE_USERLIST is set.................[ OK ] 
-2019/01/30 15:07:51  INFO: - Check if FILE_USERLIST is readable.......................[ OK ] +2019/10/16 04:00:02  INFO: Mailboxes to backup will read from file. 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  INFO: ERROR: The user: notvaild_email.net is NOT valid e-mail address! +2019/10/16 04:00:02  INFO: - File: [/​home/​klaus/​dovecot_backup.userlist] 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  INFO: - Check if FILE_USERLIST exists............................[ OK ] 
-2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: - Check if FILE_USERLIST is readable.......................[ OK ] 
-2019/01/30 15:07:51  INFO: | Run backup dovecot_backup ..................................... | +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:00:02  INFO: ERROR: The user: notvaild_email.net is NOT valid e-mail address! 
-2019/01/30 15:07:51  ​INFO:​ +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:51  INFO: Start backup process for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:51  INFO: Extract mailbox data for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: | Run backup dovecot_backup ..................................... | 
-2019/01/30 15:07:54  INFO: Synchronization done for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:54  INFO: Packaging to archive for user: klaus@tachtler.net ... +2019/10/16 04:00:02  ​INFO:​ 
-2019/01/30 15:07:54  INFO: Delete ​archive ​files for user: klaus@tachtler.net ... +2019/10/16 04:00:02  INFO: Check if TMP_FOLDER exists ................................[ OK ] 
-2019/01/30 15:07:54  INFO: Delete ​old archive ​files /srv/backup .....................[ OK ] +2019/10/16 04:​00:​02 ​ INFO: Create temporary '/​srv/​backup/​dovecot_backup-kKnIclhvj92B'​ folder [ OK ] 
-2019/01/30 15:07:54  INFO: Delete ​mailbox ​files for user: klaus@tachtler.net ... +2019/10/16 04:​00:​05 ​ INFO: Start backup process for user: klaus@tachtler.net ... 
-2019/01/30 15:07:54  INFO: Delete ​mailbox ​files at: /​srv/​backup ​.....................[ OK ] +2019/10/16 04:00:05  INFO: Extract mailbox data for user: klaus@tachtler.net ... 
-2019/01/30 15:07:54  INFO: Ended backup process for user: klaus@tachtler.net ... +2019/10/16 04:03:32  INFO: Synchronization done for user: klaus@tachtler.net ... 
-2019/01/30 15:07:54  ​INFO:​ +2019/10/16 04:03:32  INFO: Packaging to archive for user: klaus@tachtler.net ... 
-2019/01/30 15:07:54  INFO: Start backup process for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Delete ​mailbox ​files for user: klaus@tachtler.net ... 
-2019/01/30 15:07:54  INFO: Extract mailbox data for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Delete ​mailbox ​files at: /srv/backup/​dovecot_backup-kKnIclhvj92B [ OK ] 
-2019/01/30 15:07:56  INFO: Synchronization done for user: petra@tachtler.net ... +2019/10/16 04:​03:​37 ​ INFO: Copying archive file for user: klaus@tachtler.net ... 
-2019/01/30 15:07:56  INFO: Packaging to archive for user: petra@tachtler.net ... +2019/10/16 04:​03:​37 ​ INFO: Move archive file for user to: /​srv/​backup ​................[ OK ] 
-2019/01/30 15:07:56  INFO: Delete ​archive ​files for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Delete ​archive ​files for user: klaus@tachtler.net ... 
-2019/01/30 15:07:56  INFO: Delete ​old archive ​files /srv/backup .....................[ OK ] +2019/10/16 04:03:37  INFO: Delete ​old archive ​files from: /srv/backup ................[ OK ] 
-2019/01/30 15:07:56  INFO: Delete ​mailbox ​files for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Ended backup process for user: klaus@tachtler.net ... 
-2019/01/30 15:07:56  INFO: Delete ​mailbox ​files at: /​srv/​backup ​.....................[ OK ] +2019/10/16 04:03:37  ​INFO:​ 
-2019/01/30 15:07:56  INFO: Ended backup process for user: petra@tachtler.net ... +2019/10/16 04:03:37  INFO: Start backup process for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  ​INFO:​ +2019/10/16 04:03:37  INFO: Extract mailbox data for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:45  INFO: Synchronization done for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  INFO: | End backup dovecot_backup ..................................... | +2019/10/16 04:03:45  INFO: Packaging to archive for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:46  INFO: Delete ​mailbox ​files for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  ​INFO:​ +2019/10/16 04:03:46  INFO: Delete ​mailbox ​files at: /srv/backup/​dovecot_backup-kKnIclhvj92B [ OK ] 
-2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:​03:​46 ​ INFO: Copying archive file for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  INFO: | Runtime statistics............................................. | +2019/10/16 04:​03:​46 ​ INFO: Move archive file for user to: /​srv/​backup ​................[ OK ] 
-2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:46  INFO: Delete ​archive ​files for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  ​INFO:​ +2019/10/16 04:03:46  INFO: Delete ​old archive ​files from: /srv/backup ................[ OK ] 
-2019/01/30 15:​07:​56 ​ INFO: - Number of determined users: 3 +2019/10/16 04:03:46  INFO: Ended backup process for user: petra@tachtler.net ... 
-2019/01/30 15:07:56  INFO: - ...Summary of failed users: 1 +2019/10/16 04:03:53  ​INFO:​ 
-2019/01/30 15:07:56  INFO: - ...Mailbox of failed users: +2019/10/16 04:03:53  INFO: Delete temporary '/​srv/​backup/​dovecot_backup-kKnIclhvj92B'​ folder [ OK ] 
-2019/01/30 15:07:56  INFO: - ... notvaild_email.net +2019/10/16 04:​03:​53 ​ INFO: 
-2019/01/30 15:07:56  ​INFO:​ +2019/10/16 04:​03:​53 ​ INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:56  INFO: Runtime: 00:00:05 time elapsed. +2019/10/16 04:03:53  INFO: | End backup dovecot_backup ..................................... | 
-2019/01/30 15:07:56  ​INFO:​ +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:53  ​INFO:​ 
-2019/01/30 15:07:56  INFO: | Finished creating the backups [Wed, 30 Jan 2019 15:07:56 (CET)] | +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
-2019/01/30 15:07:56  INFO: +-----------------------------------------------------------------+ +2019/10/16 04:03:53  INFO: | Runtime statistics ............................................ | 
-2019/01/30 15:07:56  INFO:+2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
 +2019/10/16 04:03:53  ​INFO:​ 
 +2019/10/16 04:​03:​53 ​ INFO:2019/01/30 15:​07:​56 ​ INFO: - Number of determined users: 3 
 +2019/10/16 04:03:53  INFO: - ...Summary of failed users: 1 
 +2019/10/16 04:03:53  INFO: - ...Mailbox of failed users: 
 +2019/10/16 04:03:53  INFO: - ... notvaild_email.net 
 +2019/10/16 04:03:53  ​INFO:​ 
 +2019/10/16 04:03:53  INFO: Runtime: 00:03:56 time elapsed. 
 +2019/10/16 04:03:53  ​INFO:​ 
 +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
 +2019/10/16 04:03:53  INFO: | Finished creating the backups [Wed, 16 Oct 2019 04:03:54 (CEST)] | 
 +2019/10/16 04:03:53  INFO: +-----------------------------------------------------------------+ 
 +2019/10/16 04:03:53  INFO:
 </​code>​ </​code>​
  
tachtler/dovecot_backup_-_skript.1570458948.txt.gz · Zuletzt geändert: 2019/10/07 16:35 von klaus