매일 24h 기록 및 매주 월요일 7d 기록 알림
Some checks failed
Run Report Table / run-script (push) Failing after 11s

This commit is contained in:
kyy
2025-09-04 15:56:05 +09:00
parent f1f82aa1eb
commit fa1a259f5b
2 changed files with 9 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
name: Run Report Table
on:
schedule:
- cron: '0 21 * * *' # 06:00 KST is 21:00 UTC
- cron: "0 21 * * *" # 06:00 KST is 21:00 UTC
jobs:
run-script:
runs-on: ubuntu-latest
@@ -9,4 +9,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Run script
run: ./run_table.sh
run: |
if [ $(date -u +%u) -eq 1 ]; then
./run_table.sh 7d
else
./run_table.sh 24h
fi

View File

@@ -7,7 +7,7 @@ set +a
LOG_DIR="logs/table"
mkdir -p "${LOG_DIR}"
ABSOLUTE_RANGE=7d # 24h
ABSOLUTE_RANGE=${1:-24h}
TS="$(date +%Y%m%d_%H%M%S)"
LOG_FILE="${LOG_DIR}/report_${ABSOLUTE_RANGE}_${TS}.log"
@@ -17,10 +17,4 @@ LOG_FILE="${LOG_DIR}/report_${ABSOLUTE_RANGE}_${TS}.log"
>> "${LOG_FILE}" 2>&1 &
echo "[OK] Started background job."
echo "[OK] Logging to ${LOG_FILE}"
# # crontab -e
# # 매일 09:00 KST에 지난 24시간 보고
# 0 9 * * * /usr/bin/env bash -lc 'cd /opt/monitor && /usr/bin/python3 grafana_dash_pull_and_alert.py --range 24h'
# # 매주 월요일 09:30 KST에 지난 7일 보고
# 30 9 * * 1 /usr/bin/env bash -lc 'cd /opt/monitor && /usr/bin/python3 grafana_dash_pull_and_alert.py --range 7d'
echo "[OK] Logging to ${LOG_FILE}"