2021-08-13 15:38:51 -04:00
|
|
|
.PHONY: all
|
2021-10-08 16:08:03 -04:00
|
|
|
all:
|
|
|
|
@echo
|
|
|
|
@echo "For initial setup, run"
|
|
|
|
@echo " sudo ./initial-setup.sh"
|
|
|
|
@echo
|
|
|
|
@echo "Or run borg commands with e.g.:"
|
|
|
|
@echo " ./borg.sh info"
|
|
|
|
@echo " ./borg.sh list"
|
|
|
|
@echo
|
2021-08-19 11:55:19 -04:00
|
|
|
|
2021-10-08 16:08:03 -04:00
|
|
|
.PHONY: ctrl
|
2021-10-11 16:50:08 -04:00
|
|
|
ctrl: test-backup
|
2021-08-19 11:55:19 -04:00
|
|
|
|
2021-10-11 12:34:57 -04:00
|
|
|
.venv:
|
|
|
|
mkdir .venv
|
|
|
|
pipenv install --dev
|
2021-08-13 15:38:51 -04:00
|
|
|
|
2021-10-11 12:34:57 -04:00
|
|
|
.PHONY: test-backup
|
|
|
|
test-backup: .venv
|
|
|
|
.venv/bin/mypy backup.py
|
2021-10-15 23:21:14 -04:00
|
|
|
./backup.py -n
|
2021-08-13 15:38:51 -04:00
|
|
|
|
2021-10-11 12:34:57 -04:00
|
|
|
.PHONY: test-setup
|
|
|
|
test-setup:
|
|
|
|
shellcheck -f gcc initial-setup.sh
|
2021-08-13 10:47:41 -04:00
|
|
|
rm -rf /tmp/test-borg
|
2021-10-08 16:08:03 -04:00
|
|
|
mkdir /tmp/test-borg
|
2021-10-13 14:38:47 -04:00
|
|
|
git clone . /tmp/test-borg
|
|
|
|
#: "normally this would be a git clone, but we want the working tree..."
|
|
|
|
#git ls-files -z | tar --null -T - -cf - | tar -C /tmp/test-borg -xvf -
|
2021-10-08 16:08:03 -04:00
|
|
|
/tmp/test-borg/initial-setup.sh
|
2021-10-11 12:34:57 -04:00
|
|
|
|
2021-10-16 18:50:24 -04:00
|
|
|
# Pull master and rebase "setup-$HOSTNAME" branch onto it
|
|
|
|
.PHONY: rebase
|
|
|
|
rebase:
|
|
|
|
git checkout master
|
|
|
|
git pull
|
|
|
|
git checkout -
|
|
|
|
git rebase master
|
2021-10-26 15:03:35 -04:00
|
|
|
./initial-setup.sh --update
|
2021-10-16 23:47:34 -04:00
|
|
|
systemctl daemon-reload
|
2021-10-19 14:45:08 -04:00
|
|
|
git status
|
2021-10-16 18:50:24 -04:00
|
|
|
|
2021-10-18 15:13:10 -04:00
|
|
|
# Show status of most recent backup run
|
|
|
|
.PHONY: status
|
|
|
|
status:
|
|
|
|
systemctl status --full --lines 999999 --no-pager --all borg-backup || true
|
|
|
|
|
|
|
|
# Watch live log output
|
|
|
|
.PHONY: tail
|
|
|
|
tail:
|
|
|
|
journalctl --all --follow --lines 200 --unit borg-backup
|
|
|
|
|
2021-10-11 12:34:57 -04:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f README.html
|