My backup scripts and tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.1 KiB

9 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .PHONY: all
  2. all:
  3. @echo
  4. @echo "For initial setup, run"
  5. @echo " sudo ./initial-setup.sh"
  6. @echo
  7. @echo "Or run borg commands with e.g.:"
  8. @echo " ./borg.sh info"
  9. @echo " ./borg.sh list"
  10. @echo
  11. .PHONY: ctrl
  12. ctrl: test-backup
  13. .venv:
  14. mkdir .venv
  15. pipenv install --dev
  16. .PHONY: test-backup
  17. test-backup: .venv
  18. .venv/bin/mypy backup.py
  19. ./backup.py -n
  20. .PHONY: test-setup
  21. test-setup:
  22. shellcheck -f gcc initial-setup.sh
  23. rm -rf /tmp/test-borg
  24. mkdir /tmp/test-borg
  25. git clone . /tmp/test-borg
  26. #: "normally this would be a git clone, but we want the working tree..."
  27. #git ls-files -z | tar --null -T - -cf - | tar -C /tmp/test-borg -xvf -
  28. /tmp/test-borg/initial-setup.sh
  29. # Pull master and rebase "setup-$HOSTNAME" branch onto it
  30. .PHONY: rebase
  31. rebase:
  32. git checkout master
  33. git pull
  34. git checkout -
  35. git rebase master
  36. ./initial-setup.sh --update
  37. systemctl daemon-reload
  38. git status
  39. # Show status of most recent backup run
  40. .PHONY: status
  41. status:
  42. systemctl status --full --lines 999999 --no-pager --all borg-backup || true
  43. # Watch live log output
  44. .PHONY: tail
  45. tail:
  46. journalctl --all --follow --lines 200 --unit borg-backup
  47. .PHONY: clean
  48. clean:
  49. rm -f README.html