Restic backup to S3 storage
Restic is a fast, encrypting and deduplicating backup program. It writes directly to the S3 storage (VersityGW) on your HDD-Housing drive.
Install
apt update
apt install restic
Configure
Create /root/restic_env.sh:
export AWS_ACCESS_KEY_ID="access_key"
export AWS_SECRET_ACCESS_KEY="secret_key"
export RESTIC_REPOSITORY="s3:http://IP-OR-DNS:7070/bucket"
# Password for Restic encryption (DO NOT LOSE – REQUIRED FOR RESTORE!)
export RESTIC_PASSWORD="good_password_that_you_never_forget"
Replace access_key, secret_key, IP-OR-DNS and bucket with the values you receive with your account.
Important: Without the Restic password your backup cannot be restored – neither by you nor by us. Store it safely outside the backed-up system.
Initialise the repository:
source /root/restic_env.sh
restic init
Backup script
Create /root/restic_backup.sh:
#!/bin/bash
source /root/restic_env.sh
# Back up all listed paths into one Restic snapshot
restic backup /etc /var/www /home/user/data
Check the result with restic snapshots.