30 lines
873 B
Bash
30 lines
873 B
Bash
#!/bin/bash
|
|
echo "=== CRONTAB ==="
|
|
crontab -l 2>&1
|
|
echo "=== NODE ==="
|
|
which node
|
|
node -v
|
|
echo "=== NPM ==="
|
|
which npm
|
|
npm -v
|
|
echo "=== LOGS DIR ==="
|
|
ls -la /home/ubuntu/zhuiguang-ai/logs/ 2>&1
|
|
echo "=== TASK LOGS (last 5 each) ==="
|
|
for f in /home/ubuntu/zhuiguang-ai/logs/*.log; do
|
|
echo "--- $(basename $f) ---"
|
|
tail -5 "$f" 2>&1
|
|
done
|
|
echo "=== ENV CHECK ==="
|
|
grep -E "DEEPSEEK|DATABASE_URL|GITHUB_TOKEN|NODE_TLS" /home/ubuntu/zhuiguang-ai/.env 2>&1
|
|
echo "=== SCRIPT TEST ==="
|
|
cd /home/ubuntu/zhuiguang-ai && node -e "
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const scripts = fs.readdirSync('scripts').filter(f => f.endsWith('.mjs'));
|
|
for (const s of scripts) {
|
|
const stat = fs.statSync(path.join('scripts', s));
|
|
console.log(s, '-', stat.mtime.toISOString());
|
|
}
|
|
"
|
|
echo "=== PM2 LOGS ==="
|
|
pm2 logs zhuiguang-ai --lines 5 --nostream 2>&1 |