Fix: Remove stderr suppression from journalctl to show logs

PROBLEM:
- User running "sudo journalctl -u pbs-backup-manual.service -f" sees perfect verbose output
- But installer script shows blank screen during backup
- Progress updates like "processed 65.6 GiB in 18m" should be visible

ROOT CAUSE:
- journalctl command had "2>/dev/null" which suppressed all stderr
- This was hiding any errors or blocking journalctl from displaying properly
- The -n 100 flag was unnecessary complexity

SOLUTION:
- Removed "2>/dev/null" - allow journalctl to show its output normally
- Removed "-n 100" flag - not needed with --since
- Reduced --since from "5 seconds ago" to "2 seconds ago" for tighter window
- Kept "|| true" so Ctrl+C doesn't fail the script

Now the backup progress should display exactly like:
  processed 65.6 GiB in 18m, uploaded 64.4 GiB
  processed 69.3 GiB in 19m, uploaded 68.0 GiB
  (updates every minute during block device backup)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zaphod-black 2025-11-01 19:58:43 -05:00
parent f542fe2730
commit e333839c8b

View file

@ -1018,8 +1018,7 @@ run_backup_now() {
MONITOR_PID=$!
# Follow logs in foreground from the start (will be killed by monitor when backup completes)
# Use --since to catch logs from service start, and -n 100 to show recent context
journalctl -u pbs-backup-manual.service -f --since "5 seconds ago" -n 100 2>/dev/null || true
journalctl -u pbs-backup-manual.service -f --since "2 seconds ago" || true
# Wait for monitor to finish
wait $MONITOR_PID 2>/dev/null
@ -1174,8 +1173,7 @@ main() {
MONITOR_PID=$!
# Follow logs in foreground from the start (will be killed by monitor when backup completes)
# Use --since to catch logs from service start, and -n 100 to show recent context
journalctl -u pbs-backup-manual.service -f --since "5 seconds ago" -n 100 2>/dev/null || true
journalctl -u pbs-backup-manual.service -f --since "2 seconds ago" || true
# Wait for monitor to finish
wait $MONITOR_PID 2>/dev/null