깃헙엑션맞춤서비스~
This commit is contained in:
parent
058dd19def
commit
23cb3c7104
1 changed files with 15 additions and 13 deletions
28
app/run.sh
28
app/run.sh
|
|
@ -1,28 +1,30 @@
|
||||||
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
|
#!/bin/bash
|
||||||
echo "Debug: Script started at $(date)" >> /code/app/temp/debug.log
|
|
||||||
echo "Debug: Current directory is $(pwd)" >> /code/app/temp/debug.log
|
|
||||||
echo "Debug: User is $(whoami)" >> /code/app/temp/debug.log
|
|
||||||
echo "Debug: Environment variables:" >> /code/app/temp/debug.log
|
|
||||||
env >> /code/app/temp/debug.log
|
|
||||||
|
|
||||||
cd /code/app
|
|
||||||
|
|
||||||
# If doesn't have temp folder, create it
|
# If doesn't have temp folder, create it
|
||||||
if [ ! -d "temp" ]; then
|
if [ ! -d "temp" ]; then
|
||||||
mkdir temp
|
mkdir temp
|
||||||
fi
|
fi
|
||||||
|
echo "Debug: Script started at $(date)" >> ./temp/debug.log
|
||||||
|
echo "Debug: Current directory is $(pwd)" >> ./temp/debug.log
|
||||||
|
echo "Debug: User is $(whoami)" >> ./temp/debug.log
|
||||||
|
echo "Debug: Environment variables:" >> ./temp/debug.log
|
||||||
|
env >> ./temp/debug.log
|
||||||
|
|
||||||
|
cd ${BOT_ROOT}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If doesn't have temp/cookies.json, create it
|
# If doesn't have temp/cookies.json, create it
|
||||||
if [ ! -f "temp/cookies.json" ]; then
|
if [ ! -f "./temp/cookies.json" ]; then
|
||||||
/code/app/venv/bin/python3 library/init-auth.py
|
python3 library/init-auth.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the log file name with the current date and time
|
# Set the log file name with the current date and time
|
||||||
log_file="temp/$(date +%Y%m%d-%H%M%S).log"
|
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
|
# Run the Python script with or without --today and output to both the console and log file
|
||||||
if [[ "$1" == "--today" ]]; then
|
if [[ "$1" == "--today" ]]; then
|
||||||
/code/app/venv/bin/python3 run.py --today | tee "$log_file"
|
python3 run.py --today | tee "$log_file"
|
||||||
else
|
else
|
||||||
/code/app/venv/bin/python3 run.py | tee "$log_file"
|
python3 run.py | tee "$log_file"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue