-
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.
Merge pull request #1 from jan-brinkmann/development
development
- Loading branch information
Showing
2 changed files
with
26 additions
and
4 deletions.
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/). | ||
|
||
By using this image, you are enabled to instantiate a container that runs rotate-backups once on a mounted directory. In the mounted directory, irrelevant backups are removed and useful are preserved. Afterwards, the container is stopped and, if desired, removed. | ||
|
||
## How to use | ||
Simply adapt the directory to mount and run the following command on your Docker host: | ||
``` | ||
docker run --rm \ | ||
-v /path/to/backups:/archive \ | ||
ghcr.io/jan-brinkmann/docker-rotate-backups | ||
``` | ||
The default scheme to preserve and to remove backups is `--daily=7 --weekly=4 --monthly=12 --yearly=always --dry-run`. | ||
|
||
## How to customize | ||
The scheme can be customized by means of `ROTATION_SCHEME`: | ||
``` | ||
docker run --rm \ | ||
-e ROTATION_SCHEME="--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 options, we refer to the [official `rotate-backups` documentation](https://pypi.org/project/rotate-backups/#command-line). |
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