Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titlehow to make a sample commands file
collapsetrue
# remember that things after the # sign are ignored by bash and most all programing languages
cds  # move to your scratch directory
nano commands
 
# the following lines should be entered into nano
echo "My name is _____ and todays date is:" > GVA2019.output.txt
date >> GVA2019.output.txt
echo "I have just demonstrated that I know how to redirect output to a new file, and to append things to an already created file. Or at least thats what I think I did" >> GVA2019.output.txt
 
echo "i'm going to test this by counting the number of lines in the file that I am writing to. So if the next line reads 4 I remember I'm on the right track" >> GVA2019.output.txt
wc -l GVA2019.output.txt >> GVA2019.output.txt
 
echo "I know that normally i would be typing commands on each line of this file, that would be executed on a compute node instead of the head node so that my programs run faster, in parallel, and do not slow down others or risk my tacc account being locked out" >> GVA2019.output.txt
 
echo "i'm currently in my scratch directory on lonestar. there are 2 main ways of getting here: cds and cd $SCRATCH:" >>GVA2019.output.txt
pwd >> GVA2019.output.txt
 
echo "over the last week I've conducted multiple different types of analysis on a variety of sample types and under different conditions. Each of the exercises was taken from the website https://wikis.utexas.edu/display/bioiteam/Genome+Variant+Analysis+Course+2019" >> GVA2019.output.txt
 
echo "using the ls command i'm now going to try to remind you (my future self) of what tutorials I did" >> GVA2019.output.txt
 
ls -1 >> GVA2019.output.txt
 
echo "the contents of those directories (representing the data i downloaded and the work i did) are as follows: ">> GVA2019.output.txt
find . >> GVA2019.output.txt
 
echo "the commands that i have run on the headnode are: " >> GVA2019.output.txt
history >> GVA2019.output.txt
 
echo "the contents of this, my commands file, which i will use in the launcher_creator.py script are: ">>GVA2019.output.txt
cat commands >> GVA2019.output.txt
 
echo "finally, I will be generating a job.slurm file using the launcher_creator.py script using the following command:" >> GVA2019.output.txt
echo 'launcher_creator.py -w 1 -N 1 -n "what_i_did_at_GVA2019" -t 00:15:00 -a "UT-2015-05-18"' >> GVA2019.output.txt # this will create a my_first_job.slurm file that will run for 15 minutes
echo "and i will send this job to the que using the the command: sbatch what_i_did_at_GVA2019.slurm" >> GVA2019.output.txt  # this will actually submit the job to the Queue Manager and if everything has gone right, it will be added to the development queue.

 
ctrl o # keyboard command to write your nano output
crtl x # keyboard command to close the nano interface
wc -l commands  # use this command to verify the number of lines in your commands file.
# expected output:
30 commands

# if you get a much larger number than 30 edit your commands file with nano so each command is a single line as they appear above. 
launcher_creator.py -w 1 -N 1 -n "what_i_did_at_GVA2019_2017" -t 00:15:00 -a "UT-2015-05-18"
sbatch what_i_did_at_GVA2019.slurm

...