-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #569 from RoanKanninga/master
putting rawdata logs in the per rawdata folder
- Loading branch information
Showing
5 changed files
with
57 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
||
|
@@ -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 [[ -f $LOGDIR/${projectName}/${projectName}.pipeline.finished && ! -f $LOGDIR/${projectName}/${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 | ||
|
@@ -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 | ||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ for line in ${ARR[@]} | |
do | ||
csvFile=$(basename $line) | ||
filePrefix="${csvFile%.*}" | ||
LOGGER=${LOGDIR}/${filePrefix}.copyToPrm.logger | ||
LOGGER=${LOGDIR}/${filePrefix}/${filePrefix}.copyToPrm.logger | ||
|
||
FINISHED="no" | ||
OLDIFS=$IFS | ||
|
@@ -45,11 +45,6 @@ do | |
run=$3 | ||
IFS=$OLDIFS | ||
|
||
if [ -d ${LOGDIR}/${filePrefix}/ ] | ||
then | ||
continue | ||
fi | ||
|
||
if [ -f ${LOGDIR}/copyDataToPrm.sh.locked ] | ||
then | ||
echo "copyToPrm is locked" | ||
|
@@ -61,12 +56,6 @@ do | |
##get header to decide later which column is project | ||
HEADER=$(head -1 ${line}) | ||
|
||
if [ -d ${LOGDIR}/${filePrefix}/ ] | ||
then | ||
echo "(startPipeline) everything is finished of ${filePrefix}" | ||
continue | ||
fi | ||
|
||
##Remove header, only want to keep samples | ||
sed '1d' $line > ${LOGDIR}/TMP/${filePrefix}.utmp | ||
OLDIFS=$IFS | ||
|
@@ -96,7 +85,7 @@ do | |
copyRawDiagnosticsClusterToPrm="${RAWDATADIR}/${filePrefix}/* ${groupname}[email protected]:${RAWDATADIRPRM}/${filePrefix}" | ||
makeRawDataDir=$(ssh ${groupname}[email protected] "sh ${RAWDATADIRPRM}/../checkRawData.sh ${RAWDATADIRPRM} ${filePrefix}") | ||
|
||
if [[ -f $LOGDIR/${filePrefix}.dataCopiedToDiagnosticsCluster && ! -f $LOGDIR/${filePrefix}.dataCopiedToPrm ]] | ||
if [[ -f $LOGDIR/${filePrefix}/${filePrefix}.dataCopiedToDiagnosticsCluster && ! -f $LOGDIR/${filePrefix}/${filePrefix}.dataCopiedToPrm ]] | ||
then | ||
countFilesRawDataDirTmp=$(ls ${RAWDATADIR}/${filePrefix}/${filePrefix}* | wc -l) | ||
if [ "${makeRawDataDir}" == "f" ] | ||
|
@@ -115,22 +104,20 @@ do | |
then | ||
echo "md5sum check failed, the copying will start again" >> ${LOGGER} | ||
rsync -r -av ${copyRawDiagnosticsClusterToPrm} >> $LOGGER 2>&1 | ||
echo "copy failed" >> $LOGDIR/${filePrefix}.failed | ||
echo "copy failed" >> $LOGDIR/${filePrefix}/${filePrefix}.failed | ||
elif [[ "${COPIEDTOPRM}" == *"PASS"* ]] | ||
then | ||
scp ${SAMPLESHEETSDIR}/${csvFile} ${groupname}[email protected]:${RAWDATADIRPRM}/${filePrefix}/ | ||
scp ${SAMPLESHEETSDIR}/${csvFile} ${groupname}[email protected]:${SAMPLESHEETSPRMDIR} | ||
echo "finished copying data to calculon" >> ${LOGGER} | ||
|
||
mkdir $LOGDIR/${filePrefix}/ | ||
echo "Moving ${filePrefix} logfiles to $LOGDIR/${filePrefix}/ and removing tmp finished files" >> $LOGGER | ||
|
||
rm $LOGDIR/${filePrefix}.SampleSheetCopied | ||
rm $LOGDIR/${filePrefix}.dataCopiedToDiagnosticsCluster | ||
mv $LOGDIR/${filePrefix}.copyToDiagnosticsCluster.logger $LOGDIR/${filePrefix}/ | ||
mv $LOGDIR/${filePrefix}.copyToPrm.logger $LOGDIR/${filePrefix}/ | ||
mv ${LOGDIR}/TMP/${filePrefix}.unique.projects $LOGDIR/${filePrefix}/projects.txt | ||
#rm $LOGDIR/${filePrefix}.SampleSheetCopied | ||
#rm $LOGDIR/${filePrefix}.dataCopiedToDiagnosticsCluster | ||
#mv $LOGDIR/${filePrefix}.copyToDiagnosticsCluster.logger $LOGDIR/${filePrefix}/ | ||
#mv $LOGDIR/${filePrefix}.copyToPrm.logger $LOGDIR/${filePrefix}/ | ||
#mv ${LOGDIR}/TMP/${filePrefix}.unique.projects $LOGDIR/${filePrefix}/projects.txt | ||
echo "finished with rawdata" >> ${LOGDIR}/${filePrefix}/${filePrefix}.copyToPrm.logger | ||
|
||
if ls ${RAWDATADIR}/${filePrefix}/${filePrefix}*.log 1> /dev/null 2>&1 | ||
then | ||
logFileStatistics=$(cat ${RAWDATADIR}/${filePrefix}/${filePrefix}*.log) | ||
|
@@ -140,9 +127,9 @@ do | |
fi | ||
echo -e "De data voor project ${filePrefix} is gekopieerd naar ${RAWDATADIRPRM}" | mail -s "${filePrefix} copied to permanent storage" ${ONTVANGER} | ||
fi | ||
if [ -f $LOGDIR/${filePrefix}.failed ] | ||
if [ -f $LOGDIR/${filePrefix}/${filePrefix}.failed ] | ||
then | ||
rm $LOGDIR/${filePrefix}.failed | ||
rm $LOGDIR/${filePrefix}/${filePrefix}.failed | ||
fi | ||
fi | ||
else | ||
|
@@ -153,9 +140,9 @@ do | |
fi | ||
fi | ||
|
||
if [ -f $LOGDIR/${filePrefix}.failed ] | ||
if [ -f $LOGDIR/${filePrefix}/${filePrefix}.failed ] | ||
then | ||
COUNT=$(cat $LOGDIR/${filePrefix}.failed | wc -l) | ||
COUNT=$(cat $LOGDIR/${filePrefix}/${filePrefix}.failed | wc -l) | ||
if [ $COUNT == 10 ] | ||
then | ||
HOSTNA=$(hostname) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters