2026-05-15 15:00:10 +09:00
|
|
|
# claude_morning 실행 스크립트
|
2026-05-15 14:02:53 +09:00
|
|
|
# 작업 스케줄러에서 08:15에 실행 (평일)
|
|
|
|
|
|
2026-05-20 13:54:15 +09:00
|
|
|
chcp 65001 | Out-Null # 콘솔 코드페이지 UTF-8 (외부 프로세스 출력 디코딩)
|
2026-05-15 15:00:10 +09:00
|
|
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
|
|
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
2026-05-20 13:54:15 +09:00
|
|
|
$env:PYTHONUTF8 = "1"
|
2026-05-15 15:00:10 +09:00
|
|
|
$env:PYTHONIOENCODING = "utf-8"
|
|
|
|
|
|
|
|
|
|
$PROJECT = Split-Path -Parent $PSScriptRoot
|
2026-05-15 14:02:53 +09:00
|
|
|
$LOG = "$PROJECT\logs\morning.log"
|
2026-05-27 16:53:52 +09:00
|
|
|
. "$PROJECT\scripts\stockbot_env.ps1"
|
|
|
|
|
$CLAUDE = Resolve-StockBotClaude
|
|
|
|
|
$PYTHON = Resolve-StockBotPython -Project $PROJECT
|
2026-05-15 15:00:10 +09:00
|
|
|
$utf8 = New-Object System.Text.UTF8Encoding $false
|
2026-05-15 14:02:53 +09:00
|
|
|
|
|
|
|
|
Set-Location $PROJECT
|
|
|
|
|
|
2026-05-26 14:55:12 +09:00
|
|
|
# 공휴일 체크 — 휴장일이면 스킵
|
|
|
|
|
$holiday_result = & $PYTHON "scripts\_is_trading_day.py" 2>&1
|
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
$ts = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$ts] 휴장일 — 스킵 ($holiday_result)`n", $utf8)
|
|
|
|
|
exit
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-15 14:02:53 +09:00
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
2026-05-15 15:00:10 +09:00
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$timestamp] claude_morning 시작`n", $utf8)
|
2026-05-15 14:02:53 +09:00
|
|
|
|
2026-05-15 15:00:10 +09:00
|
|
|
& $CLAUDE -p "/morning" --dangerously-skip-permissions 2>&1 |
|
|
|
|
|
ForEach-Object { [System.IO.File]::AppendAllText($LOG, "$_`n", $utf8) }
|
2026-05-15 14:02:53 +09:00
|
|
|
|
|
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
2026-05-15 15:00:10 +09:00
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$timestamp] claude_morning 완료`n", $utf8)
|
2026-05-19 08:21:15 +09:00
|
|
|
|
|
|
|
|
# 모닝 완료 후 봇 시작 (daily_context.json 생성 보장 후 시작)
|
|
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$timestamp] /start-bot 시작`n", $utf8)
|
|
|
|
|
|
2026-06-01 18:54:52 +09:00
|
|
|
& $PYTHON "scripts\start_bot.py" 2>&1 |
|
2026-05-19 08:21:15 +09:00
|
|
|
ForEach-Object { [System.IO.File]::AppendAllText($LOG, "$_`n", $utf8) }
|
|
|
|
|
|
|
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$timestamp] /start-bot 완료`n", $utf8)
|