1 |
#! /usr/bin/env bash |
2 |
|
3 |
# $Header: $ |
4 |
# $Name: $ |
5 |
|
6 |
if test $# = 2 ; then |
7 |
pFixDir=$1 ; bakDir=$2 |
8 |
else |
9 |
echo 'Usage: '`basename $0`' {pFixDir} {bakDir}' |
10 |
echo ' Make a tar file of testreport/restart output dir, named with prefix "{pFixDir}"' |
11 |
echo ' and save it to existing dir "{bakDir}"' |
12 |
echo ' Note: to use where testreport/restart is run (i.e., in verification/)' |
13 |
exit 1 |
14 |
fi |
15 |
|
16 |
dOutp=`ls -t ${pFixDir}_20*/summary.txt | head -n 1 | sed 's/\/summary.txt//'` |
17 |
if test "x$dOutp" != x -a -d $bakDir ; then |
18 |
echo " - saving tar file of output-dir '${dOutp}' in '${bakDir}'" |
19 |
tar -cf $dOutp.tar $dOutp ; mv $dOutp.tar $bakDir |
20 |
else |
21 |
if test "x$dOutp" = x ; then |
22 |
echo " - no output-dir to save" |
23 |
else |
24 |
echo " - backup-dir '${bakDir}' not found" |
25 |
fi |
26 |
exit 2 |
27 |
fi |