Automation: Task execution results 2026-02-09 10:54:30

This commit is contained in:
2026-02-09 10:54:30 -06:00
parent f88ec8c8b6
commit 6a33a2e209
2 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
#!/bin/bash
# Setup BookStack → Gitea auto-sync
set -e
echo "=== Setting up BookStack Git Sync ==="
date
# Clone the repo to a sync location
cd /opt
git clone https://git.firefrostgaming.com/firefrost-gaming/firefrost-documentation.git
# Create sync script
cat > /opt/bookstack-sync.sh << 'SYNCEOF'
#!/bin/bash
# Sync BookStack database to Git
cd /opt/firefrost-documentation
# Export BookStack database
mysqldump -u bookstack_user -p'FirefrostBookStack2026!' bookstack_db > bookstack-backup.sql
# Add timestamp file
date > last-sync.txt
# Commit if changes
git add -A
if ! git diff --cached --quiet; then
git commit -m "BookStack backup: $(date '+%Y-%m-%d %H:%M:%S')"
git push origin main
echo "Synced to Git"
else
echo "No changes to sync"
fi
SYNCEOF
chmod +x /opt/bookstack-sync.sh
# Create cron job for hourly sync
echo "0 * * * * /opt/bookstack-sync.sh >> /var/log/bookstack-sync.log 2>&1" | crontab -
# Run initial sync
/opt/bookstack-sync.sh
echo ""
echo "=== Sync configured ==="
echo "Repository: https://git.firefrostgaming.com/firefrost-gaming/firefrost-documentation"
echo "Sync frequency: Hourly"
echo "Log: /var/log/bookstack-sync.log"

View File

@@ -0,0 +1,25 @@
Task: setup-bookstack-sync.sh
Started: Mon Feb 9 10:54:29 AM CST 2026
==========================================
=== Setting up BookStack Git Sync ===
Mon Feb 9 10:54:29 AM CST 2026
Cloning into 'firefrost-documentation'...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
[main 6c103de] BookStack backup: 2026-02-09 10:54:29
2 files changed, 1272 insertions(+)
create mode 100644 bookstack-backup.sql
create mode 100644 last-sync.txt
remote: . Processing 1 references
remote: Processed 1 references in total
To https://git.firefrostgaming.com/firefrost-gaming/firefrost-documentation.git
b2a52c3..6c103de main -> main
Synced to Git
=== Sync configured ===
Repository: https://git.firefrostgaming.com/firefrost-gaming/firefrost-documentation
Sync frequency: Hourly
Log: /var/log/bookstack-sync.log
==========================================
Finished: Mon Feb 9 10:54:30 AM CST 2026
Exit Code: 0