|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log_dir="logs" |
|
|
mkdir -p $log_dir |
|
|
timestamp=$(date +"%Y%m%d_%H%M%S") |
|
|
log_file="$log_dir/$timestamp.log" |
|
|
|
|
|
start_time=$(date +"%Y-%m-%d %H:%M:%S") |
|
|
start_sec=$(date +%s) |
|
|
echo "Script started at: $start_time" | tee -a "$log_file" |
|
|
|
|
|
|
|
|
python -m src.process_labels |
|
|
|
|
|
end_time=$(date +"%Y-%m-%d %H:%M:%S") |
|
|
end_sec=$(date +%s) |
|
|
echo "Script ended at: $end_time" | tee -a "$log_file" |
|
|
|
|
|
|
|
|
duration_sec=$((end_sec - start_sec)) |
|
|
duration_min=$(echo "scale=2; $duration_sec / 60" | bc) |
|
|
duration_hr=$(echo "scale=2; $duration_sec / 3600" | bc) |
|
|
|
|
|
echo "Total duration: " | tee -a "$log_file" |
|
|
echo "- In hours: ${duration_hr} hours" | tee -a "$log_file" |
|
|
echo "- In minutes: ${duration_min} minutes" | tee -a "$log_file" |
|
|
echo "- In seconds: ${duration_sec} seconds" | tee -a "$log_file" |
|
|
|