-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tmux.sh
40 lines (28 loc) · 1.15 KB
/
run_tmux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
## Usage: bash run_tmux.sh {tumor/normal} {CCRC/UCEC} {script_name_to_run}
## batch identifiers, t for date for differentiating runs, c for cancer type
t=$1
c=$2
## script name to run
scriptDir=$3
scriptName=$4
## user ID with permission to the input files
uid=$(id -u)
## group ID with permission to the input files
gid="2001"
## the path to master directory containing "${toolDirName}" scripts, input dependencies and output directories
toolDirName=$7
mainRunDir=$8
## the path to master directory containing input BAM files
bamDir=$9
## the name of the docker image
imageName=${10}
## the path to the binary file for the language to run inside docker container
binaryFile=${11}
## extra argument for the script
arg=$5
## working directory inside the docker container
workDir=$6
bashCMD="tmux new-session -d -s "${toolDirName}"_"${scriptName}"_"${t}"_"${c}" 'docker run --user "${uid}":"${gid}" -v "${mainRunDir}":"${mainRunDir}" -v "${bamDir}":"${bamDir}" -w "${workDir}" "${imageName}" "${binaryFile}" "${scriptDir}${scriptName}${arg}" |& tee "${mainRunDir}"logs/"${scriptName}"_"${t}"_"${c}"_"$(date +%Y%m%d%H%M%S)".log'"
echo $bashCMD
#$bashCMD