← back to Dear Bubbe Nextjs
lib/monitor-instagram.sh
38 lines
#!/bin/bash
# Instagram Posting Monitor
echo "📸 Instagram Posting System Monitor"
echo "===================================="
echo ""
# Check PM2 service
echo "🔄 PM2 Service Status:"
pm2 list | grep instagram-poster || echo "❌ Service not running"
echo ""
# Check state file
STATE_FILE="/root/Projects/dear-bubbe-admin/logs/instagram-state.json"
if [ -f "$STATE_FILE" ]; then
echo "📊 Instagram Posting Statistics:"
cat "$STATE_FILE" | python3 -m json.tool | head -20
else
echo "❌ No state file found"
fi
echo ""
# Check recent logs
echo "📝 Recent Activity (last 10 lines):"
tail -10 /root/Projects/dear-bubbe-admin/logs/instagram-pm2.log 2>/dev/null || echo "No logs found"
echo ""
# Check cron jobs
echo "⏰ Scheduled Cron Jobs:"
crontab -l | grep instagram || echo "No Instagram cron jobs found"
echo ""
# Check recent posts
echo "🖼️ Recent Generated Images:"
ls -lt /root/Projects/dear-bubbe-admin/public/instagram-*.png 2>/dev/null | head -5
echo ""
echo "✅ Monitoring complete"