Sign inSign up

jchonig/rsnapshot

By jchonig

•Updated 6 days ago

A container to run rsnapshot to back up local and remost hosts

Image
0

50K+

jchonig/rsnapshot repository overview

⁠docker-rsnapshot

A container running rsnapshot⁠ for the purpose backing up remote filesystems via ssh

Image hosted at: ghcr.io/jchonig/rsnapshot

⁠Usage

⁠docker

docker create \
  --name=rsnapshot \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -v </path/to/appdata/config>:/config \
  -v </path/to/backup_root>:/backup \
  --restart unless-stopped \
  ghcr.io/jchonig/rsnapshot
⁠docker-compose

Compatible with docker-compose v2 schemas.

---
version: "2"
services:
  rsnapshot:
    image: ghcr.io/jchonig/rsnapshot
    container_name: rsnapshot
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - </path/to/appdata/config>:/config
	  - </path/to/backup_root>:/backup
    restart: unless-stopped

⁠Parameters

⁠Environment Variables (-e)

EnvFunction
PUID=1000for UserID - see below for explanation
PGID=1000for GroupID - see below for explanation
TZ=UTCSpecify a timezone to use EG UTC

⁠Volume Mappings (-v)

VolumeFunction
/configAll the config files reside here
/backupRoot of backup dirs
/data/*Local filesystems to be backed up

⁠Application Setup

  • Environment variables can also be passed in a file named env in the config directory. This file is sourced by the shell.
  • Configure rsnapshot as follows
    • Store config file(s) in config/rsnapshot/NAME.conf
      • Set the logfile to config/log/rsnapshot.log
      • Set the backup path to /backup/${NAME}
      • If backing up local F?S, mount them under /data/*
    • Add a crontab configuration in /config/cron.d/rsnapshot-${NAME}
      • Note that the root user should not be specified in the crontab, it will be removed if present
  • Add ssh keys and configuration to config/.ssh dir

⁠Crontab example

57 17 * * * rsnapshot -c /config/rsnapshot/HOSTNAME.conf hourly
36 1 * * 0-5 rsnapshot -c /config/rsnapshot/HOSTNAME.conf daily
36 1 * * 6 rsnapshot -c /config/rsnapshot/HOSTNAME.conf weekly && rsnapshot -c /config/rsnapshot/HOSTNAME.conf daily
36 0 1 * * rsnapshot -c /config/rsnapshot/HOSTNAME.conf monthly

⁠ssh config example

Host *
    PasswordAuthentication no
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null

Host HOSTNAME
  IdentityFile ~/.ssh/KEYNAME

Tag summary

Content type

Image

Digest

sha256:dc0414111…

Size

22.9 MB

Last updated

6 days ago

docker pull jchonig/rsnapshot