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.
 
 
 

56 lines
1.1 KiB

  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. systemctl daemon-reload
  37. # Show status of most recent backup run
  38. .PHONY: status
  39. status:
  40. systemctl status --full --lines 999999 --no-pager --all borg-backup || true
  41. # Watch live log output
  42. .PHONY: tail
  43. tail:
  44. journalctl --all --follow --lines 200 --unit borg-backup
  45. .PHONY: clean
  46. clean:
  47. rm -f README.html