This commit is contained in:
imnyang 2024-11-13 00:15:20 +09:00
commit 9f4c5700b6
2 changed files with 26 additions and 11 deletions

View file

@ -1,16 +1,21 @@
cd /code/app
#rm -rf 20*.png
#rm -rf /etc/localtime
#ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# If doesn't have temp folder, create it
if [ ! -d "temp" ]; then
mkdir temp
fi
# If doesn't have temp/cookies.json, create it
if [ ! -f "temp/cookies.json" ]; then
python3 library/init-auth.py
fi
python3 run.py > temp/$(date +%Y%m%d-%H%M%S).log 2>&1
# Set the log file name with the current date and time
log_file="temp/$(date +%Y%m%d-%H%M%S).log"
# Run the Python script with or without --today and output to both the console and log file
if [[ "$1" == "--today" ]]; then
python3 run.py --today | tee "$log_file"
else
python3 run.py | tee "$log_file"
fi