summaryrefslogtreecommitdiff
path: root/Makefile
blob: 0dd9c7e42815b945c0b767e22abed613677535dc (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 = push-btrfs.path push-btrfs.service push-btrfs.timer push-btrfs@.service push-btrfs@.timer

enable_unit = push-btrfs.timer

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

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