diff --git a/initial-setup.sh b/initial-setup.sh index 558c051..1a06e2b 100755 --- a/initial-setup.sh +++ b/initial-setup.sh @@ -88,7 +88,7 @@ EOF # Copy templated files, filling in templates as needed install_templated_files() { - for i in README.md notify.sh; do + for i in README.md notify.sh logs.sh; do sed -e "s!\${HOSTNAME}!${HOSTNAME}!g" \ -e "s!\${BORG_DIR}!${BORG_DIR}!g" \ -e "s!\${BORG_BIN}!${BORG_BIN}!g" \ diff --git a/templates/README.md b/templates/README.md index ad14738..ca42e53 100644 --- a/templates/README.md +++ b/templates/README.md @@ -9,7 +9,6 @@ Run on client: Customize `/opt/borg/config.yaml` as desired. - Cheat sheet =========== @@ -29,13 +28,10 @@ See when next backup is scheduled: systemctl list-timers ${SYSTEMD_UNIT}.timer -See status of most recent backup attempt: +See log of most recent backup attempt: - journalctl --unit ${SYSTEMD_UNIT} --since "$(systemctl show -P ExecMainStartTimestamp ${SYSTEMD_UNIT})" - -Watch live log: - - journalctl --all --follow --unit ${SYSTEMD_UNIT} + ${BORG_DIR}/logs.sh + ${BORG_DIR}/logs.sh -f Start backup now: @@ -61,6 +57,13 @@ Mount and look at files: sudo -s # to explore as root sudo umount mnt +Update borg-setup from git: + + cd /opt/borg + sudo git remote update + sudo git rebase origin/master + sudo ./inital-setup.sh --update + sudo git commit -m 'Update borg-setup' ## Compaction and remote access diff --git a/templates/logs.sh b/templates/logs.sh new file mode 100644 index 0000000..29131a6 --- /dev/null +++ b/templates/logs.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec journalctl --all --unit ${SYSTEMD_UNIT} --since "$(systemctl show -P ExecMainStartTimestamp ${SYSTEMD_UNIT})" "$@"