feat(backup): add Restic S3 backup recipes

Introduce comprehensive recipes for Restic-based S3 backups.
Covers installation, S3 repository configuration, automated backup job creation, and restoration of files.
This commit is contained in:
2026-07-04 19:26:01 -03:00
parent 8266e47963
commit 6cf5a08187
4 changed files with 370 additions and 0 deletions
+95
View File
@@ -0,0 +1,95 @@
# Restore Backup
This recipe restores files from a Restic repository.
## Load Environment
```bash
source <(sudo cat /etc/restic.env)
```
## List Snapshots
```bash
restic snapshots
```
Expected output:
```text
ID Time Host
----------------------------------------
xxxxxxxx YYYY-MM-DD HH:MM
```
## Restore Latest Snapshot
```bash
restic restore latest --target /tmp/restore
```
## Restore Specific Snapshot
Replace `<snapshot-id>` with the desired snapshot.
```bash
restic restore <snapshot-id> --target /tmp/restore
```
## Restore a Single Directory
```bash
restic restore latest --target /tmp/restore --include <PATH>
```
Replace:
- `<PATH>` with the folder path you want to restore (e.g. `/srv/samba`)
## Verify Restored Files
```bash
ls -la /tmp/restore
```
## Verify Repository Integrity
```bash
restic check
```
Expected output:
```text
no errors were found
```
## Troubleshooting
### Repository not found
Verify:
```bash
echo $RESTIC_REPOSITORY
```
### Authentication failed
Verify the configured S3 credentials.
```bash
echo $AWS_ACCESS_KEY_ID
```
```bash
echo $AWS_SECRET_ACCESS_KEY
```
### Wrong password
Verify:
```bash
echo $RESTIC_PASSWORD
```