42 lines
1.4 KiB
Bash
Executable File
42 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 (using absolute path)
|
|
LOG_DIR="$SCRIPT_DIR/logs"
|
|
mkdir -p "$LOG_DIR"
|
|
|
|
# Get current timestamp
|
|
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
|
|
|
# Log file using absolute path
|
|
LOG_FILE="$LOG_DIR/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"
|