aboutsummaryrefslogtreecommitdiff
path: root/content/operations/sauvegardes
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-22 17:56:58 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-22 17:56:58 +0100
commitfe27af7a16d9bc56b0767f63d8f0490fcd2f13d1 (patch)
treeaa2545893bc1ca9f973cc45adcc0dcd2d68aef77 /content/operations/sauvegardes
parent4831ac27871e44064dc55946c5ae10b8cda32b37 (diff)
downloadguide.deuxfleurs.fr-fe27af7a16d9bc56b0767f63d8f0490fcd2f13d1.tar.gz
guide.deuxfleurs.fr-fe27af7a16d9bc56b0767f63d8f0490fcd2f13d1.zip
Migration des derniers documents depuis op_guide (dépôt infrastructure)
Diffstat (limited to 'content/operations/sauvegardes')
-rw-r--r--content/operations/sauvegardes/pg_basebackup.md25
-rw-r--r--content/operations/sauvegardes/restic.md6
2 files changed, 31 insertions, 0 deletions
diff --git a/content/operations/sauvegardes/pg_basebackup.md b/content/operations/sauvegardes/pg_basebackup.md
index fe33f94..357e11f 100644
--- a/content/operations/sauvegardes/pg_basebackup.md
+++ b/content/operations/sauvegardes/pg_basebackup.md
@@ -301,6 +301,31 @@ docker exec -ti postgres psql
rsync --progress -av /tmp/sql/{*.tar.gz,backup_manifest,dump-*} backup/target
```
+## Garbage collect old backups
+
+```
+mc ilm import deuxfleurs/${BUCKET_NAME} <<EOF
+{
+ "Rules": [
+ {
+ "Expiration": {
+ "Days": 62
+ },
+ "ID": "PurgeOldBackups",
+ "Status": "Enabled"
+ }
+ ]
+}
+EOF
+```
+
+Check that it has been activated:
+
+```
+ mc ilm ls deuxfleurs/${BUCKET_NAME}
+```
+
+
## Ref
- https://philipmcclarence.com/backing-up-and-restoring-postgres-using-pg_basebackup/
diff --git a/content/operations/sauvegardes/restic.md b/content/operations/sauvegardes/restic.md
index f959541..73463d1 100644
--- a/content/operations/sauvegardes/restic.md
+++ b/content/operations/sauvegardes/restic.md
@@ -169,3 +169,9 @@ I propose:
```
restic forget --prune --keep-within 1m1d --keep-within-weekly 3m --keep-within-monthly 1y
```
+
+Also try to restore a snapshot:
+
+```
+restic restore <snapshot id> --target /tmp/$SERVICE_NAME
+```