Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 61e505952d | |||
| 1939962b75 | |||
| f2231c7074 |
@@ -1,4 +1,4 @@
|
||||
# Mailcow Backup Using borgbackup <!-- omit in toc -->
|
||||
# Mailcow Backup Using borgbackup
|
||||
|
||||
This script automates backing up your Mailcow installation using borgbackup and a remote ssh-capable storage system. I suggest using rsync.net since they
|
||||
have great speeds and a special pricing structure for borgbackup/attic users ([details here](https://www.rsync.net/products/attic.html)).
|
||||
@@ -14,14 +14,19 @@ This script automates the following tasks:
|
||||
- Runs 'borg prune' to make sure you are trimming old backups on your schedule
|
||||
- Creates a clear, easy to parse log file so you can keep an eye on your backups and any errors/warnings
|
||||
|
||||
## Contents <!-- omit in toc -->
|
||||
## contents
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [quick start](#quick-start)
|
||||
- [configuration file](#configuration-file)
|
||||
- [running the script](#running-the-script)
|
||||
- [scheduling your backup via cron](#scheduling-your-backup-via-cron)
|
||||
- [restoring backups](#restoring-backups)
|
||||
- [final notes](#final-notes)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## quick start
|
||||
|
||||
Clone this repo or download a release file into a directory of your choosing. For all examples in this document, I will assume you will run the script from */scripts/backup*. Make sure the script file is executable and you protect the *.details* file since it contains things like your repo password:
|
||||
@@ -111,6 +116,10 @@ Edit your root user's crontab and add an entry like this which would run the scr
|
||||
7 1 * * * /scripts/backup/backup.sh -l /var/log/mailcow_backup.log > /dev/null 2>&1
|
||||
```
|
||||
|
||||
## restoring backups
|
||||
|
||||
Starting with version 3.0, a *restore.sh* file has been included to semi-automate restoring your backups to a clean mailcow instance. There are a few steps required and they are better explained in the wiki than would be possible in a short write-up like this. Please check out the [restore process overview](https://git.asifbacchus.app/asif/MailcowBackup/wiki/8.0-Restore-overview) for more information.
|
||||
|
||||
## final notes
|
||||
|
||||
I think that's everything. For detailed information, please review the [wiki](https://git.asifbacchus.app/asif/MailcowBackup/wiki/_pages). If I've forgotten to document something there, please let me know. I know the wiki is long but, I hate how much stuff for Linux and open-source programs/scripts in general are so poorly documented especially for newbies and I didn't want to make that same mistake.
|
||||
|
||||
+2
-2
@@ -690,7 +690,7 @@ printf "%s[%s] -- [INFO] Pre-backup tasks completed, calling borgbackup --%s\n"
|
||||
## construct the proper borg commandline
|
||||
# base command
|
||||
if [ "$exclusions" -eq 0 ]; then
|
||||
borgCMD="borg --show-rc create ${borgCreateParams} \
|
||||
borgCMD="borg create --show-rc ${borgCreateParams} \
|
||||
::$(date +%Y-%m-%d_%H%M%S) \
|
||||
${mcConfig%/*} \
|
||||
${sqlDumpDir} \
|
||||
@@ -701,7 +701,7 @@ if [ "$exclusions" -eq 0 ]; then
|
||||
${dockerVolumeCrypt} \
|
||||
${xtraList}"
|
||||
elif [ "$exclusions" -eq 1 ]; then
|
||||
borgCMD="borg --show-rc create ${borgCreateParams} \
|
||||
borgCMD="borg create --show-rc ${borgCreateParams} \
|
||||
--exclude-from ${borgExcludeListPath} \
|
||||
::$(date +%Y-%m-%d_%H%M%S) \
|
||||
${mcConfig%/*} \
|
||||
|
||||
Reference in New Issue
Block a user