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>
38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/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
|