In the bash
function below if the user selets "y" then the menu function is called and if they select "n" the move function is called. That all seems to work, my question is after the files are moved an echo
,
line in bold is displayed and another function called backup
is called. I am getting a syntax error on that line as that function, backup
, can not be found. After the backup function executes another function
run
is called, hopefully. It seems very close but I'm not sure if I have the syntax for making the calls correct. Thank you :).
additional() {
printf "\n\n"
printf "Are there additional files to be analyzed? Y/N "; read match_choice
case "$match_choice" in
[yY]) menu; break;;
[nN]) move; printf "Select folders are being copied to MedexPatients on medex as well as to the import folders "; break;;
esac
}
move() {
# move specific folders to MedexPatients on medex CIFS share
mkdir -p /home/cmccabe/medex/MedexPatients/$filename
rsync -av --exclude='/home/cmccabe/Desktop/NGS/API/$filename/bedtools' --exclude='/home/cmccabe/Desktop/NGS/API/$filename/torrent' --exclude='/home/cmccabe/Desktop/NGS/API/$filename/igv' /home/cmccabe/Desktop/NGS/API/$filename/bam /home/cmccabe/Desktop/NGS/API/$filename/fastqc /home/cmccabe/Desktop/NGS/API/$filename/lowcoverage /home/cmccabe/Desktop/NGS/API/$filename/panel /home/cmccabe/Desktop/NGS/API/$filename/picard /home/cmccabe/Desktop/NGS/API/$filename/vcf /home/cmccabe/Desktop/NGS/API/$filename/*.txt /home/cmccabe/Desktop/NGS/API/$filename/*.pdf /home/cmccabe/Desktop/NGS/API/$filename/*.log /home/cmccabe/medex/MedexPatients/$filename
# move to GenePerecent on CIFS share medex
rsync -av /home/cmccabe/Desktop/NGS/API/$filename/panel/20x/percent/*.txt /home/cmccabe/medex/GenePercent
# move to LowCoverage
rsync -av /home/cmccabe/Desktop/NGS/API/$filename/lowcoverage/20x/*.txt /home/cmccabe/medex/LowCoverage
# move to MedexVariants
rsync -av /home/cmccabe/Desktop/NGS/API/$filename/vcf/panel/annovar/*.txt /home/cmccabe/medex/MedexVariants
# move to Quality Metrics
rsync -av /home/cmccabe/Desktop/NGS/API/$filename/pdf/*.txt /home/cmccabe/medex/QualityMetrics
echo "analysis complete with new folder created and files moved to medex, the folder will now be sent to archive : $(backup)"
}
backup() {
# move folder to backup
printf "\n The directory will be moved to backup "; mv -v /home/cmccabe/Desktop/NGS/API/$filename /media/cmccabe/"My Book Western Digital"/ClinicalRuns; run ;;
}