-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
29 lines (20 loc) · 829 Bytes
/
Copy pathmakefile
File metadata and controls
29 lines (20 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
.DEFAULT_GOAL = install
include .env
include ../foundations.mk
.PHONY: install borgmatic repo-create run-backup
CONFIG = $(shell find ./etc | sed 's|\.||') $(shell find ./usr | sed 's|\.||')
SERVICES = $(call user-timer,nextcloud-backup) $(call timer,borgmatic)
## To generate the encrypted borgmatic.pw file this command was used
# systemd-ask-password -n | sudo systemd-creds encrypt - /etc/credstore.encrypted/borgmatic.pw
install: /usr/bin/borgmatic $(CONFIG) ~/.local/share/borgmatic $(SERVICES)
sudo systemctl daemon-reload
test: /usr/bin/borgmatic $(CONFIG) ~/.local/share/borgmatic $(SERVICES)
echo $^
~/.local/share/borgmatic:
mkdir $@
.ONESHELL: repo-create
repo-create: install
sudo borgmatic repo-create --encryption repokey
.ONESHELL: run-backup
run-backup: install
sudo borgmatic create --verbosity 2