Change 32809

russell_jackson (Russell C. Jackson (Rusty))
Russell C. Jackson (Rusty) committed this change into //guest/russell_jackson/sdp/Server/Unix/p4/common/bin
Request Review
Download .zip
Mirror script logs to the terminal when run interactively (not from cron).

Add log_init() to backup_functions.sh: when stdout is a terminal (method 2, the
-t 1 tty test), start a background 'tail -F' that mirrors EVERYTHING written to
$LOGFILE (log() narrative AND command output) to the terminal in real time, with
an EXIT trap to reap the tail. When run from cron (no tty) it is a no-op, so cron
behavior is unchanged. This keeps $LOGFILE complete/synchronous for mail_log_file
and is safe inside command substitutions. log() reverted to file-only. Call
log_init in the maintenance scripts after LOGFILE is set; gate the end-of-run
'cat $LOGFILE' in upgrade.sh/edge_dump.sh on non-terminal. Multi-agent reviewed
(shortened the trap flush sleep to 0.3s).
  • Files 23
  • Comments 0
23 edited 0 added 0 deleted
backup_functions.sh#97
Loading...
broker_rotate.sh#9
Loading...
convert_old_master_to_standby.sh#4
Loading...
convert_standby_to_master.sh#8
Loading...
daily_checkpoint.sh#17
Loading...
edge_dump.sh#9
Loading...
journal_watch.sh#2
Loading...
keep_offline_db_current.sh#2
Loading...
live_checkpoint.sh#7
Loading...
p4cachepurge.sh#5
Loading...
proxy_rotate.sh#2
Loading...
recover_edge.sh#16
Loading...
recreate_db_checkpoint.sh#15
Loading...
recreate_db_sync_replica.sh#28
Loading...
recreate_offline_db.sh#8
Loading...
refresh_P4ROOT_from_offline_db.sh#2
Loading...
replica_cleanup.sh#11
Loading...
replica_status.sh#22
Loading...
request_replica_checkpoint.sh#2
Loading...
rotate_journal.sh#9
Loading...
sync_replica.sh#38
Loading...
upgrade.sh#22
Loading...
verify_shelves.sh#7
Loading...
Tip: Use n and p to cycle through the changes.