coreos-home-server/config/common/systemd/container-volume-backup@.timer
Alex Palaistras 41328342b3 Implement basic volume backup and restore mechanism
This commit implements three new services, specifically:

  - The `container-volume` service, which applies to a specific volume
    name and ensures this exists. This is mainly useful as a dependency
    to other services, as Podman will create named volumes itself if
    needed.

  - The `container-volume-backup` service, which creates a `tar.gz`
    snapshot of the given volume's contents in `/var/lib/backups`.

  - The `container-volume-restore` service, which populates an empty
    volume from a pre-existing file in `/var/lib/backups`, presumably
    created by `container-volume-backup`.

These are then be used to automatically create volume snapshots every 12
hours, rolling over every 7 days.
2021-08-14 22:38:17 +01:00

10 lines
146 B
SYSTEMD

[Unit]
Description=Scheduled backup for container volume %i
[Timer]
OnCalendar=00/12:30
RandomizedDelaySec=15m
[Install]
WantedBy=timers.target