backup via minio and restic #25

Open
opened 2024-12-23 18:21:35 +00:00 by Erik · 3 comments
Owner

Currently I have the following entry in my crontab to back up my server:

0 3 * * 6 restic -p /.repo-pass -r rclone:nc-hetzner:/Backup/mail/ backup /opt/ && curl -d "hetzner-mail backup finished" https://notify.grobecker.me/backup

which copies everything in the /opt/ directory to my NC account, which was an "ok" solution.

However I now want to utilize the separate mailcow-backup script and object storage like minio to correctly back things up

  • rewrite crontab-entry
  • use minio additionally
Currently I have the following entry in my crontab to back up my server: ``` 0 3 * * 6 restic -p /.repo-pass -r rclone:nc-hetzner:/Backup/mail/ backup /opt/ && curl -d "hetzner-mail backup finished" https://notify.grobecker.me/backup ``` which copies everything in the /opt/ directory to my NC account, which was an "ok" solution. However I now want to utilize the separate **mailcow-backup script** and object storage like **minio** to correctly back things up - [ ] rewrite crontab-entry - [ ] use minio additionally
Erik self-assigned this 2024-12-23 18:21:39 +00:00
Author
Owner

First I'd need to figure out where the backup should go and how:

  1. continue using rclone with restic and just add minio to the mix, which would have three backup locations (including the server), however I would have to figure out how to add another destination for restic
  2. try to come up with something else entirely
First I'd need to figure out where the backup should go and how: 1. continue using rclone with restic and just add minio to the mix, which would have **three** backup locations (including the server), however I would have to figure out how to add another destination for restic 2. try to come up with something else entirely
Author
Owner

Nevermind, I'll first implement a new restic repo JUST for mailcow and then handle the rest later

Nevermind, I'll first implement a new restic repo **JUST** for mailcow and then handle the rest later
Author
Owner

my first try at this script would be this:

#!/bin/bash

mkdir /tmp/mailcow-backup
MAILCOW_BACKUP_LOCATION=/tmp/mailcow-backup

/opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all --delete-days 3

# could be made into a loop...
rclone copy $MAILCOW_BACKUP_LOCATION minio-mail:/mails/ # TODO: ensure that bucket path is correct
rclone copy $MAILCOW_BACKUP_LOCATION nc-hetzner:/... #TODO: needs a new directory

rm -rf $MAILCOW_BACKUP_LOCATION
my first try at this script would be this: ```bash #!/bin/bash mkdir /tmp/mailcow-backup MAILCOW_BACKUP_LOCATION=/tmp/mailcow-backup /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all --delete-days 3 # could be made into a loop... rclone copy $MAILCOW_BACKUP_LOCATION minio-mail:/mails/ # TODO: ensure that bucket path is correct rclone copy $MAILCOW_BACKUP_LOCATION nc-hetzner:/... #TODO: needs a new directory rm -rf $MAILCOW_BACKUP_LOCATION ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Erik/server#25
No description provided.