diff --git a/remove_lanes.sh b/remove_lanes.sh new file mode 100755 index 0000000..8803d0f --- /dev/null +++ b/remove_lanes.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -euo pipefail + +# Script made from the page +# https://docs.ycrc.yale.edu/clusters-at-yale/guides/cryosparc/ + +script_path=$(dirname "$0") # relative +script_path=$(cd "${script_path}" && pwd) # absolutized and normalized + +install_path="$HOME"/cryosparc + +# set up some more paths +db_path=${install_path}/database +worker_path=${install_path}/cryosparc2_worker + +echo "[Info] Starting the master if needed" +if [ $(${install_path}/cryosparc_master/bin/cryosparcm.sh status | grep -c "CryoSPARC is not running") -eq 1 ]; then + ${install_path}/cryosparc_master/bin/cryosparcm.sh start +fi + +old_lanes=$(${install_path}/cryosparc_master/bin/cryosparcm cli 'get_scheduler_lanes()' | grep -oP "(?<=')izar.*?(?=')") + +for _lane in $old_lanes; do + ${install_path}/cryosparc_master/bin/cryosparcm cli "remove_scheduler_lane('${_lane}')" +done + +#${install_path}/cryosparc_master/bin/cryosparcm.sh stop