Something went wrong. Try again.
Something went wrong. Try again.
690 B · 20 lines
Shell
at main
123456789101112131415161718192021#!/usr/bin/env bash# Enable a small persistent journal on an already-provisioned Pi so the next# incident leaves logs. Idempotent; prompts for the sudo password. New# provisions get this from provision-pi.sh automatically.set -euo pipefailcd "$(dirname "$0")/.."
PI=${PI:-pi}
scp -q pi/journald-persistent.conf "$PI":/tmp/
ssh -t "$PI" "sudo bash -c 'set -emkdir -p /etc/systemd/journald.conf.dmv /tmp/journald-persistent.conf /etc/systemd/journald.conf.d/persistent.confsystemctl restart systemd-journaldjournalctl --flush # move the current boot from tmpfs to diskjournalctl --disk-usage'"echo "persistent journal enabled. past boots: ssh $PI 'journalctl --list-boots'"