forked from syntaxbullet/aurorabot
feat: Introduce scripts for database backup, restore, and log viewing, replacing remote dashboard and studio scripts.
This commit is contained in:
38
shared/scripts/logs.sh
Executable file
38
shared/scripts/logs.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# Aurora Log Viewer
|
||||
# =============================================================================
|
||||
# Usage: ./logs.sh [app|db|all] [-f]
|
||||
# Default: app container, follow mode
|
||||
# =============================================================================
|
||||
|
||||
SERVICE=${1:-app}
|
||||
FOLLOW="-f"
|
||||
|
||||
if [[ "$1" == "-f" ]]; then
|
||||
SERVICE="app"
|
||||
FOLLOW="-f"
|
||||
elif [[ "$2" == "-f" ]]; then
|
||||
FOLLOW="-f"
|
||||
elif [[ "$2" == "--no-follow" ]]; then
|
||||
FOLLOW=""
|
||||
fi
|
||||
|
||||
echo "📋 Fetching logs for service: $SERVICE..."
|
||||
|
||||
case $SERVICE in
|
||||
app)
|
||||
docker compose logs $FOLLOW app
|
||||
;;
|
||||
db)
|
||||
docker compose logs $FOLLOW db
|
||||
;;
|
||||
all)
|
||||
docker compose logs $FOLLOW
|
||||
;;
|
||||
*)
|
||||
echo "Unknown service: $SERVICE"
|
||||
echo "Usage: ./logs.sh [app|db|all] [-f]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user