Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation regarding BACKUP_KEEP_**** behaviour #141

Open
lordraiden opened this issue Jun 1, 2023 · 2 comments
Open

Improve documentation regarding BACKUP_KEEP_**** behaviour #141

lordraiden opened this issue Jun 1, 2023 · 2 comments

Comments

@lordraiden
Copy link

lordraiden commented Jun 1, 2023

I have this variables set to 0

BACKUP_KEEP_WEEKS | Number of weekly backups to keep before removal. Defaults to 4.

BACKUP_KEEP_MONTHS | Number of monthly backups to keep before removal. Defaults to 6.

pgbackups:
   container_name: Immich_pgbackups  
   image: prodrigestivill/postgres-backup-local
   restart: unless-stopped
   user: postgres:postgres # Optional: see below
   networks:
     - immich_network    
   volumes:
     - /mnt/user/Docker/Immich/pgbackups:/backups
   links:
     - database
   depends_on:
     - database
   environment:
     - TZ
     - POSTGRES_HOST=database
     - POSTGRES_PASSWORD=${DB_PASSWORD}
     - POSTGRES_USER=${DB_USERNAME}
     - POSTGRES_DB=${DB_DATABASE_NAME}
    #- POSTGRES_PASSWORD_FILE=/run/secrets/db_password <-- alternative for POSTGRES_PASSWORD (to use with docker secrets)
     - POSTGRES_EXTRA_OPTS=-Z6
     - SCHEDULE=30 1 */3 * * #At 01:30 AM, every 3 days
     - BACKUP_KEEP_DAYS=6
     - BACKUP_KEEP_WEEKS=1
     - BACKUP_KEEP_MONTHS=0
     - HEALTHCHECK_PORT=5432

But I still get monthy backups stored, is there a way to configure this only to keep 6 days of backup? not weekly not monthly?

I get a folder called last, with the same backup that in the daily....

@Tyree
Copy link

Tyree commented Nov 28, 2023

I see this is another one of those super-active github projects.
I'm also confused by the KEEP settings. I just want to have daily backups for the past two weeks (no more than 14 backups kept).

@Tyree
Copy link

Tyree commented Nov 28, 2023

Okay. Reading the documentation, I can see in our case we only need to pay attention to the last folder. Other folders just have hard links to the files in the last folder. So, yeah, you'll always have a file in the month folder as there will always be a latest backup for the current month.
It's all about this last folder and the BACKUP_KEEP_MINS variable. If you want to keep the last 6 backups, then I guess you have to set this to 8640??? The doc says the MINS settings will remove any backups from the last folder that are older then its value. So, if a backup is more than 8640 minutes old (6 days), then it'll delete it.
Then you can still set the DAYS to 6 and see the same backup files in there as the last folder. The week and month folder should then always have 1 file each, the latest backup.
Backup retention settings are very convoluted.

@prodrigestivill prodrigestivill changed the title BACKUP_KEEP_****=0 behaviour Improve documentation regarding BACKUP_KEEP_**** behaviour Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants