diff --git a/automation/logs/setup-bookstack-sync_completed_20260209_105430.sh b/automation/logs/setup-bookstack-sync_completed_20260209_105430.sh new file mode 100755 index 0000000..0e95ce1 --- /dev/null +++ b/automation/logs/setup-bookstack-sync_completed_20260209_105430.sh @@ -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" diff --git a/automation/results/setup-bookstack-sync_result.txt b/automation/results/setup-bookstack-sync_result.txt new file mode 100644 index 0000000..e46eac8 --- /dev/null +++ b/automation/results/setup-bookstack-sync_result.txt @@ -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