#!/bin/bash # # Example data staging job script that copies a directory from Datastore to Eddie with rsync # # Job will restart from where it left off if it runs out of time # (so setting an accurate hard runtime limit is less important) # Grid Engine options start with a #$ #$ -N stageout_Log #$ -cwd # Choose the staging environment #$ -q staging # Hard runtime limit #$ -l h_rt=01:00:00 # Make the job resubmit itself if it runs out of time: rsync will start where it left off #$ -r yes #$ -notify trap 'exit 99' sigusr1 sigusr2 sigterm #POSIX signals #$ -t 1-2 #array # Source and destination directories # SAMPLE is the name from the samples.txt list. From this base name bellow add the parts of the path that are the same for all samples, and leave "$SAMPLE" as the variable name. #ID file IDFILE=/exports/eddie/scratch/$USER/Chimeras/Data/samples_last2Met.txt # Assigning SAMPLE variable from the built-in array counter SAMPLE=`sed -n ${SGE_TASK_ID}p "$IDFILE"` SOURCE=/exports/cmvm/eddie/scs/groups/Williamsdata/Chimeras/outs/filter_70/CellRanger-onlyCB/human/$SAMPLE DESTINATION=/exports/cmvm/datastore/scs/groups/Williamsdata/Nina/Chimeras/outs/filter_70/CellRanger-onlyCB/human # Perform copy with rsync # Note: do not use -p or -a (implies -p) as this can break file ACLs at the destination #rsync -rl --remove-source-files ${SOURCE} ${DESTINATION} mkdir -p $DESTINATION rsync -rl ${SOURCE} ${DESTINATION}