From 1df2cdb081f1f3e7b056521755b29602aa930c5d Mon Sep 17 00:00:00 2001 From: Jan Brinkmann Date: Sat, 8 Jan 2022 21:46:25 +0100 Subject: [PATCH 1/2] Update documentation. --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ded7ab..6c44fc9 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ -# docker-rotate-backups \ No newline at end of file +# 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). \ No newline at end of file From 0dd2e4caea3713e96dc7bed5fd086f203c6bca19 Mon Sep 17 00:00:00 2001 From: Jan Brinkmann Date: Sat, 8 Jan 2022 22:01:52 +0100 Subject: [PATCH 2/2] Rename variable and update documentation. --- README.md | 12 ++++++------ src/entrypoint.sh | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6c44fc9..52503f1 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ # 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. +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 in your Docker host: +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 schema to preserve and to remove backups is `--daily=7 --weekly=4 --monthly=12 --yearly=always --dry-run`. +The default scheme 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`: +The scheme can be customized by means of `ROTATION_SCHEME`: ``` docker run --rm \ --e ROTATE_BACKUPS_CONFIG="--daily=7 --weekly=4 --monthly=6" \ +-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 option of the schema, we refer to the [official `rotate-backups` documentation](https://pypi.org/project/rotate-backups/#command-line). \ No newline at end of file +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). diff --git a/src/entrypoint.sh b/src/entrypoint.sh index dbb9eec..24a986d 100644 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -2,8 +2,8 @@ set -e -if [ -z $ROTATE_BACKUPS_CONFIG ]; then - ROTATE_BACKUPS_CONFIG="--daily=7 --weekly=4 --monthly=12 --yearly=always --dry-run" +if [ -z $ROTATION_SCHEME ]; then + ROTATION_SCHEME="--daily=7 --weekly=4 --monthly=12 --yearly=always --dry-run" fi -/usr/local/bin/rotate-backups $ROTATE_BACKUPS_CONFIG /archive +/usr/local/bin/rotate-backups $ROTATION_SCHEME /archive