58 lines
1.1 KiB
Makefile
58 lines
1.1 KiB
Makefile
.PHONY: all
|
|
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
|
|
|
|
.PHONY: ctrl
|
|
ctrl: test-backup
|
|
|
|
.venv:
|
|
mkdir .venv
|
|
pipenv install --dev
|
|
|
|
.PHONY: test-backup
|
|
test-backup: .venv
|
|
.venv/bin/mypy backup.py
|
|
./backup.py -n
|
|
|
|
.PHONY: test-setup
|
|
test-setup:
|
|
shellcheck -f gcc initial-setup.sh
|
|
rm -rf /tmp/test-borg
|
|
mkdir /tmp/test-borg
|
|
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 -
|
|
/tmp/test-borg/initial-setup.sh
|
|
|
|
# Pull master and rebase "setup-$HOSTNAME" branch onto it
|
|
.PHONY: rebase
|
|
rebase:
|
|
git checkout master
|
|
git pull
|
|
git checkout -
|
|
git rebase master
|
|
./initial-setup.sh --update
|
|
systemctl daemon-reload
|
|
git status
|
|
|
|
# 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
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f README.html
|