Skip to content

Commit

Permalink
updated copyProjectDataToPrm logger
Browse files Browse the repository at this point in the history
  • Loading branch information
RoanKanninga committed Jul 8, 2016
1 parent c4815b9 commit 853cf95
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions compute5/NGS_Automated/copyProjectDataToPrm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo "Logfiles will be written to $LOGDIR"
for line in ${ARR[@]}
do
projectName=${line}
LOGGER=${LOGDIR}/${projectName}.copyProjectDataToPrm.logger
LOGGER=${LOGDIR}/${projectName}/${projectName}.copyProjectDataToPrm.logger

FINISHED="no"

Expand All @@ -49,7 +49,7 @@ do
makeProjectDataDir=$(ssh ${groupname}[email protected] "sh ${PROJECTSDIRPRM}/checkProjectData.sh ${PROJECTSDIRPRM} ${projectName}")

copyProjectDataDiagnosticsClusterToPrm="${PROJECTSDIR}/${projectName}/* ${groupname}[email protected]:${PROJECTSDIRPRM}/${projectName}"
if [[ -d $LOGDIR/${projectName}/ && ! -f $LOGDIR/${projectName}.projectDataCopiedToPrm ]]
if [[ -d $LOGDIR/${projectName}/ && ! -f $LOGDIR/${projectName}/${projectName}.projectDataCopiedToPrm ]]
then
countFilesProjectDataDirTmp=$(ls -R ${PROJECTSDIR}/${projectName}/*/results/ | wc -l)
module load hashdeep/4.4-foss-2015b
Expand All @@ -76,19 +76,16 @@ do
then
echo "md5sum check failed, the copying will start again" >> ${LOGGER}
rsync -r -av --exclude rawdata/ ${copyProjectDataDiagnosticsClusterToPrm} >> $LOGGER 2>&1
echo "copy failed" >> $LOGDIR/${projectName}.copyProjectDataToPrm.failed
echo "copy failed" >> $LOGDIR/${projectName}/${projectName}.copyProjectDataToPrm.failed
elif [[ "${COPIEDTOPRM}" == *"PASS"* ]]
then
touch $LOGDIR/${projectName}.projectDataCopiedToPrm
touch $LOGDIR/${projectName}/${projectName}.projectDataCopiedToPrm
echo "finished copying project data to calculon" >> ${LOGGER}
printf "De project data voor project ${projectName} is gekopieerd naar ${PROJECTSDIRPRM}" | mail -s "project data for project ${projectName} is copied to permanent storage" ${ONTVANGER}

mv $LOGDIR/${projectName}.projectDataCopiedToPrm $LOGDIR/${projectName}/
mv $LOGDIR/${projectName}.copyProjectDataToPrm.logger $LOGDIR/${projectName}/

if [ -f $LOGDIR/${projectName}.copyProjectDataToPrm.failed ]
if [ -f $LOGDIR/${projectName}/${projectName}.copyProjectDataToPrm.failed ]
then
rm $LOGDIR/${projectName}.copyProjectDataToPrm.failed
rm $LOGDIR/${projectName}/${projectName}.copyProjectDataToPrm.failed
fi
fi
else
Expand All @@ -98,9 +95,9 @@ do
fi
fi

if [ -f $LOGDIR/${projectName}.copyProjectDataToPrm.failed ]
if [ -f $LOGDIR/${projectName}/${projectName}.copyProjectDataToPrm.failed ]
then
COUNT=$(cat $LOGDIR/${projectName}.copyProjectDataToPrm.failed | wc -l)
COUNT=$(cat $LOGDIR/${projectName}/${projectName}.copyProjectDataToPrm.failed | wc -l)
if [ $COUNT == 10 ]
then
HOSTNA=$(hostname)
Expand Down

0 comments on commit 853cf95

Please sign in to comment.