Last active 1 month ago

Commands used as shown in the video https://youtu.be/P-Pr7Dy6mP8 .

Revision 5b69f589381562e2f0098251695a0a31f6f08117

1_minio-console-commands.sh Raw
1# Add new S3 user to Minio
2mc admin user add thasystems "s3-username" "s3-password"
3
4# Create and attach S3 policy to user in Minio
5mc admin policy create thasystems restic_sample_policy /tmp/restic_policy.json
6mc admin policy attach thasystems "restic_sample_policy" --user "s3-username"
7
8# Create new bucket 'resticsample' and ignore if it already exists
9mc mb --ignore-existing thasystems/resticsample
10
restic-backup-and-restore.sh Raw
1# (environment) variables you need
2export AWS_ACCESS_KEY_ID="s3-username"
3export AWS_SECRET_ACCESS_KEY="s3-password"
4export RESTIC_PASSWORD="password"
5
6# initialize Minio Backup Repository
7restic -r s3:https://s3.domain.tld/resticsample init
8
9# Export PostGreSQL Dump of Zammad database
10sudo -u postgres pg_dump --dbname zammad --no-privileges --no-owner >> /tmp/zammad.psql
11
12# Backup complete Zammad directory with database dump
13restic -r s3:https://s3.domain.tld/resticsample migrate
14restic --no-scan --read-concurrency=25 --pack-size=128 --compression off -r s3:https://s3.domain.tld/resticsample backup --exclude "/opt/zammad/tmp/*" /opt/zammad/ /tmp/zammad.psql
15
16# Restore a PostGreSQL Dump from Repo
17restic -r s3:https://s3.domain.tld/resticsample dump latest '/tmp/zammad.psql' | sudo -u postgres psql zammad
18
19# Restore Zammad filesystem
20restic -r s3:https://s3.domain.tld/resticsample restore latest --include /opt/zammad/ --target /
21
restic-repository-management.sh Raw
1# List all snapshots of the backup repository
2restic -r s3:https://s3.domain.tld/resticsample
3
4# List files in your backup
5restic -r s3:https://s3.domain.tld/resticsample ls --long latest /opt/zammad/config/
6
7# Mount your backup for easier search of files all over all snapshots
8# (technically works for restore too, but slower)
9restic -r s3:https://s3.domain.tld/resticsample mount /mnt/
10
11# Apply snapshot hold policy and remove snapshots older than defined rules
12restic -r s3:https://s3.domain.tld/resticsample forget --group-by '' --keep-hourly 1 --keep-daily 14 --prune
13
14# Read 25% of your backup to verify its integrity
15restic -r s3:https://s3.domain.tld/resticsample check --read-data-subset=25%
16# Do it on 100% of your backup
17restic -r s3:https://s3.domain.tld/resticsample check
18
19# Change the current password of a repository key
20restic -r s3:https://s3.domain.tld/resticsample key passwd
21
22# Add further keys to your repository
23restic -r s3:https://s3.domain.tld/resticsample key add
24
25# List all configured keys
26restic -r s3:https://s3.domain.tld/resticsample key list
27
28# Remove a certain key ID (from previous list)
29restic -r s3:https://s3.domain.tld/resticsample key remove <id>
30
31# Unlock a locked backup repository
32restic -r s3:https://s3.domain.tld/resticsample unlock
33
restic_policy.json Raw
This file can't be rendered. View the full file.