Sign inSign up

romanhajek/cron-rsync

By romanhajek

•Updated 8 months ago

Dockerized scheduled rsync backup to e.g., NAS.

Image
Networking
Databases & storage
0

1.2K

romanhajek/cron-rsync repository overview

GitHub

⁠Docker cron rsync

  • Inspired by Glideh/docker-cron-rsync⁠
  • Dockerized scheduled rsync backup to e.g., NAS.
  • SSH key is mounted as a secret.
  • Output from rsync is redirected to stdout, so it can be monitored in Docker logs.
version: "3.9"

services:
  rsync:
    image: romanhajek/cron-rsync
    secrets:
      - source: rsync-ssh-key
        target: /run/secrets/rsync-ssh-key
        mode: 0600
    environment:
      RSYNC_CRONTAB: "*/15 * * * *"
      RSYNC_OPTIONS: >-
        --archive --verbose --delete --copy-links
        -e "ssh -i /run/secrets/rsync-ssh-key -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null -o WarnWeakCrypto=no"
        /backup/ user@nas:backup/
    volumes:
      - /dir-to-backup:/backup

secrets:
  rsync-ssh-key:
    external: true

Tag summary

Content type

Image

Digest

sha256:6b6212111…

Size

6.1 MB

Last updated

8 months ago

docker pull romanhajek/cron-rsync