Skip to content

Commit

Permalink
Merge pull request #3 from jan-brinkmann/Allow-configuration-file
Browse files Browse the repository at this point in the history
Allow configuration file
  • Loading branch information
jan-brinkmann authored Jan 12, 2022
2 parents c8d202d + 41e4129 commit e93d3f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ ghcr.io/jan-brinkmann/docker-rotate-backups
```
For more information on the syntax and the options, we refer to the [official `rotate-backups` documentation](https://pypi.org/project/rotate-backups/#command-line).

### Configuration File
It is also possible to overhand a scheme within a configuration file `rotate-backups.ini`:
```
docker run --rm \
-v /path/to/backups:/archive \
-v /path/to/rotate-backups.ini:/config/rotate-backups.ini \
ghcr.io/jan-brinkmann/docker-rotate-backups
```
In order to find out how to create such a file, we again refer to the [documentation](https://pypi.org/project/rotate-backups/#configuration-files).

### Separate Variables
The scheme can also be customized by a number of environmental variables representing various time spans:
Variable | Default Value | Possible Values | Notes
Expand Down
4 changes: 4 additions & 0 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e

if [ -f "/config/rotate-backups.ini" ]; then
ROTATION_SCHEME="-c /config/rotate-backups.ini"
fi

HOURLY="${HOURLY:-0}"
DAILY="${DAILY:-7}"
WEEKLY="${WEEKLY:-4}"
Expand Down

0 comments on commit e93d3f6

Please sign in to comment.