Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-25 08:29:08

0001 #!/bin/bash
0002 
0003 # This script is intended to be called from a single cron job.
0004 # It sets up the environment and then calls a Python script
0005 # to dispatch production control jobs for various steer files.
0006 
0007 # Get the directory of this script to robustly locate other scripts
0008 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
0009 
0010 # Source the main environment setup. Redirect output as it's noisy.
0011 source "${SCRIPT_DIR}/this_sphenixprod.sh" >& /dev/null
0012 
0013 if [ -z "$1" ]; then
0014     echo "Usage: $0 <path_to_steer_list_file> [stagger_seconds]" >&2
0015     echo "Error: First argument (path to steer list file) is required." >&2
0016     exit 1
0017 fi
0018 
0019 # The first argument is the file listing active production steer files.
0020 ACTIVE_PROD_LIST=$1
0021 # The second argument is the stagger time in seconds. Default to 120 if not provided.
0022 STAGGER_SECONDS=${2:-180}
0023 
0024 # Call the dispatcher script.
0025 # The dispatcher will read the list of steer files and run production_control.py for each.
0026 # Stagger launches to avoid all jobs starting at the same time.
0027 "${SCRIPT_DIR}/dispatch_productions.py" --steer-list "${ACTIVE_PROD_LIST}" --stagger "${STAGGER_SECONDS}" -vv