migrate-contents-automation/sync-content-pro-site/check-sync-logs

28 lines
542 B
Bash
Executable File

#!/bin/bash
LOG_FILE="/var/log/hugo_sync.log"
echo "🔍 Checking Hugo Sync Log: $LOG_FILE"
# Check if log file exists
if [[ ! -f "$LOG_FILE" ]]; then
echo "❌ Log file not found."
exit 1
fi
echo ""
echo "🗂️ Recent Sync Summary:"
echo "--------------------------"
# Show last 10 sync entries
tail -n 10 "$LOG_FILE" | grep 'Synced:' || echo "No recent sync entries."
echo ""
echo "📅 Last Sync Time:"
stat -c "Last modified: %y" "$LOG_FILE"
echo ""
echo "📈 Total sync entries so far:"
grep -c 'Synced:' "$LOG_FILE"