acme-archive.sh 734 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

set -e

function usage () {
    echo "Usage: $0 -stage N"
}

if [ $# -eq 0 ]; then
    usage
    exit 1
fi

while [ $# -ne 0 ]; do
    case "$1" in
        -stage)
Juve, Gideon's avatar
Juve, Gideon committed
17
            shift
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
            STAGE=$1
            ;;
        *)
            usage
            exit 1
            ;;
    esac
    shift
done

if [ -z "$STAGE" ]; then
    echo "ERROR: Specify -stage"
    usage
    exit 1
fi

if ! [ -z "$PBS_O_WORKDIR" ]; then
    cd $PBS_O_WORKDIR
fi

CASE=$(./xmlquery CASE -valonly -silent)
RUNDIR=$(./xmlquery RUNDIR -valonly -silent)
RUNDIR=$(cd $RUNDIR && pwd)
Juve, Gideon's avatar
Juve, Gideon committed
41
42
43
44
45
DIR=$(pwd)
cd $RUNDIR
touch outputs_to_ignore
tar -czv -f $DIR/${CASE}.stage${STAGE}.tar.gz -X outputs_to_ignore ${CASE}.*
ls ${CASE}.* > outputs_to_ignore
46