summaryrefslogtreecommitdiff
path: root/Makefile
blob: 03387dd3d920cb251b639f788aef68da615469d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
config_dir = /etc/btrfs-backup/remotes
remotes = $(notdir $(wildcard $(config_dir)/*.json))

ifeq ($(remotes),)
$(error You must put at least one *.json configuration file into <file:///$(config_dir)>).
endif

unit_files = $(wildcard src/*.service src/*.timer)

enable_unit = push-btrfs.timer

install:
	systemctl link $(addprefix ./, $(unit_files))
	systemctl reset-failed $(notdir $(enable_unit))
	systemctl enable --now $(notdir $(enable_unit))

go:
	for remote in $(remotes); do bash$(if $(verbose), -x) push-btrfs $$remote$(if $(verbose),;, &) done; wait