Replies: 3 comments
-
|
My recommendation: Just backup the various directories of the software, not sure if they'd run without some repair because borg wouldn't be application-aware and the files would be open but you could stop the server at 3am, back it up, then restart the server post backup with the hooks. that would probably be the best way. Since borg only backs up the changed blocks, it would likely be quick. Your night-owls might complain. If you wanted just a few seconds of downtime, if you are running on ZFS or a filesystem that supports snapshots, you could do a stop of the server, snapshot, then start it back up, then backup from the snapshot. This is what a lot of commercial apps do. post backup script, delete the snapshot. Mailcow Backup with BBS using ZFS Snapshots This approach gives you consistent backups with only a few seconds of downtime:
Setup Assumes mailcow is installed at /opt/mailcow-dockerized with data on a ZFS dataset called tank/mailcow mounted at /var/lib/mailcow. Pre-backup script (/usr/local/bin/mailcow-backup-pre.sh): MAILCOW_DIR="/opt/mailcow-dockerized" Stop mailcow (few seconds of downtime)cd "$MAILCOW_DIR" && docker compose down Take a point-in-time snapshotzfs snapshot "${ZFS_DATASET}@${SNAP_NAME}" Start mailcow back up immediatelycd "$MAILCOW_DIR" && docker compose up -d Mount the snapshot read-only for borg to back up frommkdir -p "$SNAP_MOUNT" echo "Snapshot ready at $SNAP_MOUNT" Post-backup script (/usr/local/bin/mailcow-backup-post.sh): ZFS_DATASET="tank/mailcow" Unmount and destroy the snapshotumount "$SNAP_MOUNT" 2>/dev/null || true echo "Snapshot cleaned up" BBS Configuration
How it works
Without ZFS If you're not on ZFS, you can still use the same approach with simpler scripts that just stop/start mailcow: Pre-backup: stop mailcowcd /opt/mailcow-dockerized && docker compose down Post-backup: start mailcowcd /opt/mailcow-dockerized && docker compose up -d Set your backup directory to /var/lib/mailcow (or wherever mailcow stores its data). Downtime will last for the entire backup duration, so schedule it during low-traffic hours. |
Beta Was this translation helpful? Give feedback.
-
|
like mailcow has a backup script in it. it's just in case you can get them to work together somehow. where borg triggers the mail script and picks it up when it's done. Maybe a little over complicated. Now you can go in and run the script first. You can run it in a cron task. |
Beta Was this translation helpful? Give feedback.
-
|
You can easily do this with the Shell Script plugin today:
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
What I would like is to be able to take care of backups from mailcow. Since we have support for databases but not from email server, I think that would make it even more powerful.
Beta Was this translation helpful? Give feedback.
All reactions