From e85a6f52c58d847a47b6f854edd5d14eab4a5af0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 8 Dec 2024 08:46:00 -0500 Subject: [PATCH] Update log journalctl -af for real-time log --- log | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/log b/log index 9c69874c..f5b301c5 100755 --- a/log +++ b/log @@ -2,20 +2,26 @@ echo -e "\nLog file script for CubeSatSim\n" +echo "To exit, type Control-C" + +echo + +sleep 2 + if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then - sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt - cat /home/pi/CubeSatSim/logt.txt - echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" + sudo journalctl -af -u transmit # > /home/pi/CubeSatSim/logt.txt +# cat /home/pi/CubeSatSim/logt.txt +# echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt" elif [ "$1" = "-c" ]; then - sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt + sudo journalctl -af -u command # > /home/pi/CubeSatSim/logc.txt cat /home/pi/CubeSatSim/logc.txt - echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" +# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt" elif [ "$1" = "-p" ]; then - sudo journalctl -a -u pacsatsim > /home/pi/CubeSatSim/logp.txt + sudo journalctl -af -u pacsatsim # > /home/pi/CubeSatSim/logp.txt cat /home/pi/CubeSatSim/logp.txt - echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" +# echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logp.txt" else - sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt - cat /home/pi/CubeSatSim/log.txt - echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + sudo journalctl -af -u cubesatsim # > /home/pi/CubeSatSim/log.txt +# cat /home/pi/CubeSatSim/log.txt +# echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" fi