feat(ops): launchd jobs (nightly + market-open) + caffeinate + install scripts
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016DvdRZkyCy9NJpHYDdPqmS
This commit is contained in:
1 parent
05a8457067
commit
afc9106773
8 files changed
+129
No files matched your search
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install the launchd jobs (caffeinate, nightly research, market-open execution).
|
||||
set -euo pipefail
|
||||
PROJ="/Users/aryan/Documents/GitHub/trading-agent"
|
||||
LA="$HOME/Library/LaunchAgents"
|
||||
mkdir -p "$LA" "$PROJ/state/logs"
|
||||
chmod +x "$PROJ/scripts/nightly.sh" "$PROJ/scripts/execute.sh"
|
||||
|
||||
for p in caffeinate nightly market_open; do
|
||||
cp "$PROJ/launchd/ai.tradingagent.$p.plist" "$LA/"
|
||||
launchctl unload "$LA/ai.tradingagent.$p.plist" 2>/dev/null || true
|
||||
launchctl load "$LA/ai.tradingagent.$p.plist"
|
||||
echo "loaded ai.tradingagent.$p"
|
||||
done
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
── ONE-TIME MANUAL STEP (needs sudo) ─────────────────────────────
|
||||
Wake the Mac nightly at 23:55 CT so the 00:00 job can fire:
|
||||
|
||||
sudo pmset repeat wakeorpoweron MTWRFSU 23:55:00
|
||||
|
||||
── REQUIREMENTS for overnight runs ───────────────────────────────
|
||||
• plugged into AC power
|
||||
• lid OPEN (caffeinate can't beat clamshell sleep on a laptop)
|
||||
• logged in (lock screen is fine; logged out = jobs won't run)
|
||||
• oMLX running with a model available (it auto-starts on login)
|
||||
• .env populated with Alpaca paper + Finnhub keys
|
||||
──────────────────────────────────────────────────────────────────
|
||||
EOF
|
||||
Reference in new issue
Block a user