• Created automated setup_embedding_cron_auto.sh script that fully configures cron jobs without manual intervention • Enhanced embedding pipeline logging and error handling • Simplified AI processor to focus on core fact extraction functionality • Added proper logging to all scripts for better monitoring
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Embedding pipeline cron job script
|
|
# This script runs the advanced embedding pipeline periodically
|
|
|
|
# Set working directory to script location
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
# Create log directory if it doesn't exist
|
|
mkdir -p logs
|
|
|
|
# Get current timestamp
|
|
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
|
|
|
# Log file
|
|
LOG_FILE="logs/embedding_pipeline_$TIMESTAMP.log"
|
|
|
|
echo "===============================================" >> $LOG_FILE
|
|
echo "Starting embedding pipeline at $(date)" >> $LOG_FILE
|
|
echo "===============================================" >> $LOG_FILE
|
|
|
|
# Run the embedding pipeline with full error capture
|
|
python3 advanced_embedder.py >> $LOG_FILE 2>&1
|
|
|
|
EXIT_CODE=$?
|
|
if [ $EXIT_CODE -eq 0 ]; then
|
|
echo "Embedding pipeline completed successfully at $(date)" >> $LOG_FILE
|
|
echo "SUCCESS: Embedding pipeline completed with exit code $EXIT_CODE" >> $LOG_FILE
|
|
else
|
|
echo "Embedding pipeline failed at $(date)" >> $LOG_FILE
|
|
echo "ERROR: Embedding pipeline failed with exit code $EXIT_CODE" >> $LOG_FILE
|
|
fi
|
|
|
|
echo "===============================================" >> $LOG_FILE
|
|
echo "Embedding pipeline finished at $(date)" >> $LOG_FILE
|
|
echo "===============================================" >> $LOG_FILE
|
|
|
|
# Also log to stdout for immediate visibility
|
|
echo "Embedding pipeline run completed at $(date) - Check $LOG_FILE for details"
|