-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverSideList.sh
More file actions
42 lines (37 loc) · 796 Bytes
/
serverSideList.sh
File metadata and controls
42 lines (37 loc) · 796 Bytes
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
41
42
#!/bin/bash
# Example server-side script for listing files in HOME at server side
# Author: Peter Nordin
# working directory
wd="mytask"
# zip file with task related files
taskfile="mytask.zip"
# model name
hmffile="mymodel.hmf"
# opt script
optfile="myoptinstruct.txt"
# output file
outputfile="mytaskoutput.txt"
# Init output file
date > $outputfile
hostname >> $outputfile
# First clear old data
if [ -d $wd ]; then
rm -rf $wd
fi
# Create work dir
mkdir -p $wd
# Move files to work dir
pwd >> $outputfile
ls -l >> $outputfile
mv $outputfile $wd
mv $taskfile $wd || { exit 1; }
# Enter work dir
cd $wd
# Unpack task related files
unzip -o $taskfile
pwd >> $outputfile
ls -l >> $outputfile
# Prepare for task execution
# Start the task
sleep 1
# Post process (zip result files if needed)