Skip to content

Utility for scheduled directory and Docker volume archival for periodic backups.

Notifications You must be signed in to change notification settings

aschzero/reflektor

Repository files navigation

reflektor

reflektor is a utility for scheduled directory or Docker volume archival for periodic backups.

Configuration

Jobs are defined in a yaml configuration file with a name, source path to be archived, and the scheduled defined using cron.

Example:

jobs:
  - name: prometheus
    source: /prometheus
    schedule: "@monthly"

  - name: elasticsearch
    source: /elasticsearch
    schedule: "@weekly"
    
  - name: unifi_backups
    source: /unifi
    schedule: "0 0 * * SUN"

Usage

Command Line

Build reflektor using make build:

cd /path/to/reflektor
make build
./reflektor -config.file=/path/to/config.yml

Using Docker

Mount the directories to be archived along with your config file in a reflektor container. Ensure archives are saved to the host machine with a mount pointing to /archives:

docker run -v /path/to/config.yml:/config.yml \
    -v prometheus_prometheus:/prometheus \
    -v logs_elasticsearch:/elasticsearch \
    -v unifi_data:/unifi \
    -v /host/path/to/archives:/archives \
    aschzero/reflektor:latest -config.file=/config.yml

Archives

When a job is ready to run, an archive of the source directory is archived in a .tar.gz file in the /archives directory.

Logging

When started, reflektor parses the config file and schedules each job as a cron schedule. Job details are logged to stdout including the next run time.

INFO[0000] job scheduled       job=prometheus          next_run="2019-05-01 00:00:00 -0700 PDT"
INFO[0000] job scheduled       job=elasticsearch       next_run="2019-04-28 00:00:00 -0700 PDT"
INFO[0000] job scheduled       job=unifi_backups       next_run="2019-04-27 00:00:00 -0700 PDT"

Logs for finished running jobs include the elapsed time it took for archival:

INFO[0003] job running        job=prometheus
INFO[0003] job finished       elapsed=225.157555s job=prometheus next_run="2019-06-01 00:00:00 -0700 PDT"

About

Utility for scheduled directory and Docker volume archival for periodic backups.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published