Skip to content

Commit d059b4d

Browse files
committed
Cleaning
1 parent e207bfc commit d059b4d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/nectarchain/user_scripts/jlenain/dqm_job_submitter/cronjob_launchDQM.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ localParentDir="/data/nvme/ZFITS"
1616
remoteParentDir="/vo.cta.in2p3.fr/nectarcam"
1717
nectarchainScriptDir="$HOME/local/src/python/cta-observatory/nectarchain/src/nectarchain/user_scripts/jlenain/dqm_job_submitter"
1818

19-
cd $nectarchainScriptDir
19+
cd $nectarchainScriptDir || (echo "Failed to cd into ${nectarchainScriptDir}, exiting..."; exit 1)
2020

2121
for run in $(find ${localParentDir} -type f -name "NectarCAM*.fits.fz" | awk -F. '{print $2}' | awk -Fn '{print $2}' | sort | uniq); do
2222
echo "Probing files for run ${run}"
2323
nbLocalFiles=$(find ${localParentDir} -type f -name "NectarCAM.Run${run}.????.fits.fz" | wc -l)
2424
echo " Found $nbLocalFiles local files for run $run"
25-
nbRemoteFiles=$(dfind $remoteParentDir | grep -e "NectarCAM.Run${run}" | grep -e "fits.fz" | wc -l)
25+
nbRemoteFiles=$(dfind ${remoteParentDir} | grep -e "NectarCAM.Run${run}" | grep --count -e "fits.fz")
2626
echo " Found $nbRemoteFiles remote files on DIRAC for run $run"
2727
# If number of local and remote files matching, will attempt to launch a DQM run
28-
if [ $nbLocalFiles -eq $nbRemoteFiles ]; then
28+
if [ ${nbLocalFiles} -eq ${nbRemoteFiles} ]; then
2929
echo " Run $run: number of local and remote files matching, will attempt to submit a DQM job"
3030
# Has this DQM run already been submitted ?
31-
if [ $(dstat | grep -e "NectarCAM DQM run ${run}" | wc -l) -eq 0 ]; then
31+
if [ $(dstat | grep --count -e "NectarCAM DQM run ${run}") -eq 0 ]; then
3232
yyyymmdd=$(find ${localParentDir} -type f -name "NectarCAM.Run${run}.????.fits.fz" | head -n 1 | awk -F/ '{print $6}')
3333
yyyy=${yyyymmdd:0:4}
3434
mm=${yyyymmdd:4:2}

0 commit comments

Comments
 (0)