Skip to content

Glideh/docker-cron-rotate-backups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker cron rotate backups

Uses rotate-backups with a scheduled job to maintain a list of files limited to a given time range.

Example in a Docker composition

version: "3"

services:
  rotate:
    image: glide/cron-rotate-backups:0.1
    volumes:
      - ./backup:/data
    environment:
      ROTATE_CRON: "* * * * *"
      ROTATE_OPTIONS: "--daily=7 --weekly=4 --monthly=12 --yearly=2"

This will maintain files of a backup directory.
It will keep one file for each last 7 days, 4 weeks, 12 months, 2 years and remove the other files.
It will run every minutes to make sure the directory is up to date.
Use --dry-run to check what would happen before to avoid loosing unexpected files.

See rotate-backups doc for more informations

About

Rotate files on cron

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published