From 3563d75a926e8763e75c679c9dc02742ec61c327 Mon Sep 17 00:00:00 2001 From: John Howe <89397553+timerring@users.noreply.github.com> Date: Tue, 11 Mar 2025 14:33:02 +0800 Subject: [PATCH] fix: retain runtime logs (#191) fix #183 --- logs/{blrecLog => blrec}/.gitkeep | 0 logs/runtime/.gitkeep | 0 record.sh | 8 ++++++-- scan.sh | 2 +- settings.toml | 2 +- src/config.py | 2 +- upload.sh | 3 +-- 7 files changed, 10 insertions(+), 7 deletions(-) rename logs/{blrecLog => blrec}/.gitkeep (100%) create mode 100644 logs/runtime/.gitkeep diff --git a/logs/blrecLog/.gitkeep b/logs/blrec/.gitkeep similarity index 100% rename from logs/blrecLog/.gitkeep rename to logs/blrec/.gitkeep diff --git a/logs/runtime/.gitkeep b/logs/runtime/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/record.sh b/record.sh index 714af1c..dfe73c6 100755 --- a/record.sh +++ b/record.sh @@ -9,5 +9,9 @@ host=0.0.0.0 port=2233 kill -9 $(ps aux | grep '[b]lrec' | awk '{print $2}') -nohup blrec -c $config --open --host $host --port $port > $BILIVE_PATH/logs/blrec.log 2>&1 & -echo "blrec run success!" \ No newline at end of file +nohup blrec -c $config --open --host $host --port $port > $BILIVE_PATH/logs/runtime/blrec-$(date +%Y%m%d-%H%M%S).log 2>&1 & +if [ $? -eq 0 ]; then + echo "success" +else + echo "An error occurred while starting blrec. Check the logs for details." +fi \ No newline at end of file diff --git a/scan.sh b/scan.sh index 66329ae..17149ac 100755 --- a/scan.sh +++ b/scan.sh @@ -1,7 +1,7 @@ # kill the previous scanSegments process kill -9 $(ps aux | grep 'src.burn.scan' | grep -v grep | awk '{print $2}') # start the scanSegments process -python -m src.burn.scan +nohup python -m src.burn.scan > $BILIVE_PATH/logs/runtime/scan-$(date +%Y%m%d-%H%M%S).log 2>&1 & # Check if the last command was successful if [ $? -eq 0 ]; then echo "success" diff --git a/settings.toml b/settings.toml index f22f19c..8b4cbdb 100644 --- a/settings.toml +++ b/settings.toml @@ -13,7 +13,7 @@ duration_limit = 1800 out_dir = "./Videos" [logging] -log_dir = "./logs/blrecLog" +log_dir = "./logs/blrec" console_log_level = "INFO" backup_count = 30 diff --git a/src/config.py b/src/config.py index 7d7ed5e..79bef61 100644 --- a/src/config.py +++ b/src/config.py @@ -6,7 +6,7 @@ from datetime import datetime import configparser # ============================ Your configuration ============================ -GPU_EXIST=True +GPU_EXIST=False # Can be pipeline, append, merge MODEL_TYPE = "append" Inference_Model = "small" diff --git a/upload.sh b/upload.sh index 0063994..71c80bf 100755 --- a/upload.sh +++ b/upload.sh @@ -2,8 +2,7 @@ kill -9 $(ps aux | grep '[u]pload' | awk '{print $2}') kill -9 $(ps aux | grep '[b]iliup' | awk '{print $2}') # start the scanSegments process -# nohup $BILIVE_PATH/src/upload/uploadQueue.sh > $BILIVE_PATH/logs/uploadQueue.log 2>&1 & -python -m src.upload.upload +nohup python -m src.upload.upload > $BILIVE_PATH/logs/runtime/upload-$(date +%Y%m%d-%H%M%S).log 2>&1 & # Check if the last command was successful if [ $? -eq 0 ]; then echo "success"