Hi,

Galaxy 16.04, sge as batch system.
There is strange submit script from one job which replicates whole Galaxy home directory to the working directory for jobs and does this 2 times.
Am I correct that tool_script.sh file is generated automatically by Galaxy or still user can add something there? If it generates automatically then is this a bug?

cat 
tool_script.sh:

#!/bin/bash

# The following block can be used by the job system
# to ensure this script is runnable before actually attempting
# to run it.
if [ -n "$ABC_TEST_JOB_SCRIPT_INTEGRITY_XYZ" ]; then
   exit 42
fi
PACKAGE_BASE=/home/galaxy/tools/dependencies/samtools/1.2/iuc/package_samtools_1_2/f6ae3ba3f3c1; export PACKAGE_BASE; . /home/galaxy/tools/dependencies/samtools/1.2/iuc/package_samtools_1_2/f6ae3ba3f3c1/env.sh; MEM=`expr "${GALAXY_SLOTS:-16}" \* 48 - 16` ;  workdir=`pwd`; echo "workdir is $workdir"; cd $LOCAL; echo "Running Trinity from `pwd`";  Trinity --max_memory "${MEM}G" --CPU "${GALAXY_SLOTS:-16}" --bflyHeapSpaceMax "32G" --bflyHeapSpaceInit "2G" --bflyGCThreads "6"   --left /home/galaxy/database/files/000/dataset_81417.dat --right /home/galaxy/database/files/000/dataset_81418.dat --seqType fq --SS_lib_type RF --group_pairs_distance 500   > /home/galaxy/database/files/000/dataset_81515.dat 2>&1  || (ec=$? ; cp -pr . $workdir; cd $workdir; cat /home/galaxy/database/files/000/dataset_81515.dat >&2 ; mkdir -p trinity_out_dir ; touch trinity_out_dir/Trinity.fasta ; exit $ec);  cp -pr . $workdir; cd $workdir

Output is:
workdir is /home/galaxy/database/jobs_directory/000/51718/working
Running Trinity from /home/galaxy

It means that in "cd $LOCAL" LOCAL variable is undefined. And then there is a bunch of copies from home directory.

Thanx for the help,
Nikolaos