-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathrun-sampler.sh
executable file
·44 lines (36 loc) · 939 Bytes
/
run-sampler.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
41
42
43
#########################################################################
# File Name: run.sh
# Author: Lin Ma
# mail: [email protected]
# Created Time: 03/04/17
#########################################################################
#!/bin/bash
trap onexit 1 2 3 15
function onexit() {
local exit_status=${1:-$?}
pkill -f rnn.tag
exit $exit_status
}
USAGE='usage: run.sh input_folder output_folder'
if [ "$#" -ne 2 ]; then
echo $USAGE
exit
fi
mkdir -p $2
for file in `find $1 -type f`
do
filename=`basename $file`
if [[ $filename == *"schema"* ]]; then
command="cp $file $2/"
else
if [ -f $2/$filename.anonymized.gz ]; then
continue
fi
command="./data-sampler.py $file | gzip --best > $2/$filename.anonymized.sample.gz"
fi
if [ ! -f "$2/$filename.anonymized.sample.gz" ]; then
echo $command
eval $command &
fi
done
wait