~maddevelopers/mg5amcnlo/WWW5_caching

« back to all changes in this revision

Viewing changes to users/mardelcourt/PROC_427003/PROC_427003/bin/internal/restore_data

  • Committer: John Doe
  • Date: 2013-03-25 20:27:02 UTC
  • Revision ID: john.doe@gmail.com-20130325202702-5sk3t1r8h33ca4p4
first clean version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
#   Routine to copy all of the necessary results.dat files
 
4
#   into the appropriate location so gen_grid_jobs has necessary
 
5
#   information
 
6
#
 
7
#  
 
8
#   First we need to get into the main directory
 
9
#
 
10
if [[  ! -d ./bin  ]]; then
 
11
    cd ../
 
12
    if [[ ! -d ./bin ]]; then
 
13
        echo "Error: store must be executed from the main, or bin directory"
 
14
        exit
 
15
    fi
 
16
fi
 
17
if [[ ! -d SubProcesses ]]; then
 
18
    echo "Error: SubProcesses directory not found"
 
19
    exit
 
20
fi
 
21
cd SubProcesses
 
22
if [[  "$1" == ""  ]]; then
 
23
    echo 'Enter you must specify a name to store files under. (eg restore_data TeV)'     
 
24
    exit
 
25
fi
 
26
 
 
27
 
 
28
if [[  "$1" == ""  ]]; then
 
29
    echo 'Enter you must specify a name to store files under. (eg restore_data TeV)'     
 
30
    exit
 
31
fi
 
32
 
 
33
 
 
34
cp  $1_results.dat results.dat  >& /dev/null
 
35
for i in `cat subproc.mg` ; do
 
36
    cd $i
 
37
    echo $i
 
38
    rm -f ftn25 ftn26 >& /dev/null
 
39
    cp $1_results.dat results.dat  >& /dev/null
 
40
    for k in G* ; do
 
41
        if [[ ! -d $k ]]; then
 
42
            continue
 
43
        fi
 
44
        cd $k
 
45
        for j in $1_results.dat ; do
 
46
            if [[ -e $j ]] ; then
 
47
                cp  $j results.dat
 
48
            fi
 
49
        done
 
50
        for j in $1_ftn26.gz ; do
 
51
            if [[ -e $j ]]; then
 
52
                rm -f ftn26 >& /dev/null
 
53
                rm -f $1_ftn26 >& /dev/null
 
54
                gunzip $j
 
55
                cp $1_ftn26 ftn26
 
56
                gzip $1_ftn26
 
57
            fi
 
58
        done
 
59
        cd ../
 
60
    done
 
61
    cd ../
 
62
done
 
63
 
 
64