diff options
author | Alex <alex@adnab.me> | 2022-12-25 10:39:17 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-12-25 10:39:17 +0000 |
commit | 8364e4bcb54bfa265fc55c57adcf7bcb4e5f5869 (patch) | |
tree | d96310296cb80212b2d781c185a2ccb4e0367668 /content/operations/sauvegardes/pg_basebackup.md | |
parent | 4831ac27871e44064dc55946c5ae10b8cda32b37 (diff) | |
parent | 0a37d155dda915f80cc70d5bbd223d820f996511 (diff) | |
download | guide.deuxfleurs.fr-8364e4bcb54bfa265fc55c57adcf7bcb4e5f5869.tar.gz guide.deuxfleurs.fr-8364e4bcb54bfa265fc55c57adcf7bcb4e5f5869.zip |
Merge pull request 'MàJ générale' (#18) from maj-generale-2022 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/guide.deuxfleurs.fr/pulls/18
Diffstat (limited to 'content/operations/sauvegardes/pg_basebackup.md')
-rw-r--r-- | content/operations/sauvegardes/pg_basebackup.md | 25 |
1 files changed, 25 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/ |