-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95f89ea
commit 1df2cdb
Showing
1 changed file
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
# docker-rotate-backups | ||
# docker-rotate-backups | ||
This repository provides a Docker image that implements [`rotate-backups`](https://pypi.org/project/rotate-backups/). | ||
|
||
Using this image you are enabled to instantiate container that runs rotate-backups once on a mounted directory where your backups are stored. Afterwards, the container is stopped and, if desired, removed. | ||
|
||
## How to use | ||
Simply adapt the directory to mount and run the following command in your Docker host: | ||
``` | ||
docker run --rm \ | ||
-v /path/to/backups:/archive \ | ||
ghcr.io/jan-brinkmann/docker-rotate-backups | ||
``` | ||
The default schema to preserve and to remove backups is `--daily=7 --weekly=4 --monthly=12 --yearly=always --dry-run`. | ||
|
||
## How to customize | ||
The schema can be customized by means of `ROTATE_BACKUPS_CONFIG`: | ||
``` | ||
docker run --rm \ | ||
-e ROTATE_BACKUPS_CONFIG="--daily=7 --weekly=4 --monthly=6" \ | ||
-v /path/to/backups:/archive \ | ||
ghcr.io/jan-brinkmann/docker-rotate-backups | ||
``` | ||
For more information on the synthax and the option of the schema, we refer to the [official `rotate-backups` documentation](https://pypi.org/project/rotate-backups/#command-line). |