Projekt

Allgemein

Profil

MailCow » Historie » Revision 2

Revision 1 (Jeremias Keihsler, 01.09.2021 15:59) → Revision 2/7 (Jeremias Keihsler, 01.09.2021 17:05)

h1. MailCow 

 h2. Backup-Mailserver 

 interesting article covering that topic 
 https://autoize.com/backup-mx-configuration-for-mailcow/ 

 h2. Backup 

 taken from https://mailcow.github.io/mailcow-dockerized-docs/b_n_r_backup/ 

 create backup-target-location 

 <pre><code class="shell"> 
 mkdir /mnt/mailcow_backups 
 </code></pre> 

 create daily-backup-script @/etc/cron.daily/mailcow_backup.sh@ 
 <pre><code class="shell"> 
 #!/bin/sh 

 # Backup mailcow data 
 # https://mailcow.github.io/mailcow-dockerized-docs/b_n_r_backup/ 

 set -e 

 OUT="$(mktemp)" 
 export MAILCOW_BACKUP_LOCATION="/mnt/mailcow_backups" 
 SCRIPT="/opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh" 
 PARAMETERS="backup all" 
 OPTIONS="--delete-days 30" 

 # run command 
 set +e 
 "${SCRIPT}" ${PARAMETERS} ${OPTIONS} 2>&1 > "$OUT" 
 RESULT=$? 

 if [ $RESULT -ne 0 ] 
     then 
             echo "${SCRIPT} ${PARAMETERS} ${OPTIONS} encounters an error:" 
             echo "RESULT=$RESULT" 
             echo "STDOUT / STDERR:" 
             cat "$OUT" 
 fi 
 </code></pre>