forked from CMSROMA/Utilities
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlocalCopy.sh
More file actions
executable file
·56 lines (47 loc) · 835 Bytes
/
localCopy.sh
File metadata and controls
executable file
·56 lines (47 loc) · 835 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
PREFIX=Higgs
usage(){
echo "Usage: `basename $0` ./filelist/sample.list" > /dev/stderr
}
case $# in
0)
echo -n "Error: "
usage
exit 1
;;
*)
;;
esac
for i in $@; do
echo -n "Check file $i: "
if [ ! -r "$i" ]; then
echo "File $i not found or not readable"
exit 1
fi
echo
done
for ciao in $@; do
filelist=(`cat $ciao`)
sample=`basename $ciao .list`
# creo la cartella
if [ ! -d "/u2/" ]; then
dir=/tmp/$USER/$PREFIX/skimmed/$sample
else
dir=/u2/$USER/$PREFIX/skimmed/$sample
fi
if [ ! -d "$dir" ]; then
mkdir $dir -p
fi
echo "Copy $ciao"
for i in ${filelist[@]}; do
echo "- copy: $i"
file=`basename $i`
if [ ! -r "$dir/$file" ]; then
# (rfcp $i $dir &)
rfcp $i $dir &
fi
done
done
wait
echo "Copy completed"
exit 0