snap-sync: enable snapper to admin snap-sync backups on target

- create and verify snapper compatible structure on target host
- create snapper config (snap-$selected_config) on target host
  if not already available. use a snap-sync template.
- change userdata for snapper listings on target config
  subvolid, uuid and hostname reflact the values from the source system
- introduce a snapper template (/etc/snapper/config-templates/snap-sync)
- adapt Makefile to support an initial snap-sync template
  per default, this templates excludes snap-sync backup configs
  from timeline and cleanup tasks

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2017-11-13 11:47:56 +01:00
parent ee1ed3b4ed
commit fe15397f33
3 changed files with 110 additions and 36 deletions

View File

@@ -18,6 +18,7 @@
PKGNAME = snap-sync
PREFIX ?= /usr
SNAPPER_CONFIG ?= /etc/sysconfig/snapper
SNAPPER_TEMPLATES ?= /etc/snapper/config-templates
BIN_DIR = $(DESTDIR)$(PREFIX)/bin
SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system
@@ -27,3 +28,4 @@ SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system
install:
@./find_snapper_config || sed -i 's@^SNAPPER_CONFIG.*@SNAPPER_CONFIG='$(SNAPPER_CONFIG)'@g' bin/$(PKGNAME)
@install -Dm755 bin/* -t $(BIN_DIR)/
@install -Dm644 ./$(SNAPPER_TEMPLATES)/* -t $(SNAPPER_TEMPLATES)/