docs: Add comprehensive documentation and helper scripts
Add: - QUICKSTART.md: 5-minute quick start guide with examples - scripts/incus_setup.sh: Automated PostgreSQL container setup - scripts/validate_migration.sql: SQL validation queries - scripts/setup_cron.sh: Cron job setup for incremental migrations - tests/test_setup.py: Unit tests for configuration and transformation - install.sh: Quick installation script Documentation includes: - Step-by-step setup instructions - Example queries for RAWDATACOR and ELABDATADISP - Troubleshooting guide - Performance optimization tips 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
37
scripts/setup_cron.sh
Executable file
37
scripts/setup_cron.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# Setup cron job for incremental migration
|
||||
|
||||
PROJECT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
VENV_PYTHON="$PROJECT_DIR/venv/bin/python"
|
||||
LOG_FILE="$PROJECT_DIR/migration_$(date +%Y%m%d).log"
|
||||
|
||||
# Create cron job entry
|
||||
CRON_ENTRY="0 */6 * * * cd $PROJECT_DIR && $VENV_PYTHON main.py migrate incremental >> $LOG_FILE 2>&1"
|
||||
|
||||
echo "Cron job to be added:"
|
||||
echo "$CRON_ENTRY"
|
||||
echo ""
|
||||
echo "This will run incremental migration every 6 hours."
|
||||
echo ""
|
||||
|
||||
# Check if already exists
|
||||
if crontab -l 2>/dev/null | grep -q "migrate incremental"; then
|
||||
echo "⚠ Cron job already exists"
|
||||
echo ""
|
||||
echo "Current cron jobs:"
|
||||
crontab -l | grep -v '^#' | grep -v '^$'
|
||||
else
|
||||
echo "Add to crontab? (y/n)"
|
||||
read -r response
|
||||
|
||||
if [ "$response" = "y" ]; then
|
||||
# Add cron job
|
||||
(crontab -l 2>/dev/null; echo "$CRON_ENTRY") | crontab -
|
||||
echo "✓ Cron job added successfully"
|
||||
echo ""
|
||||
echo "Verify with: crontab -l"
|
||||
echo "View logs: tail -f migration_*.log"
|
||||
else
|
||||
echo "Cron job not added"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user