source: TOOLS/PACK_IPSL/tar_full_simu.sh @ 1856

Last change on this file since 1856 was 1847, checked in by acosce, 12 years ago

Add case where we tar all the simulation (< 1Go, or create_etat0_limit case)

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2
3
4while [ $# -ne 0 ]
5do
6        case $1 in
7       -h|--help|-help)
8                echo "----------------------------------------------------------------------------"
9                echo "Description:"
10                echo "tar a full simulation"
11                echo "----------------------------------------------------------------------------"
12                exit ;;
13        -*)
14                `dirname $0`/tar_full_simu.sh -h
15                exit ;;
16        *)
17                break ;;
18        esac
19done
20
21dirin=$1
22dirout=$2
23config_card=$3
24eval $(grep JobName  ${config_card}) 
25
26
27if [[ ! -f $PATH_SIMU/tar_full_simul.list  ]] ; then
28        `dirname $0`/tar_full_simu.sh -h
29        exit
30fi
31
32fileout=${JobName}.tar
33filefirst=`head -n 1 $PATH_SIMU/tar_full_simul.list`
34dirinputfile=`dirname $filefirst`
35diroutputfile=`dirname $filefirst | sed -e "s%$dirin%$dirout%"` 
36
37outputfile=$diroutputfile/${fileout}
38mkdir -p $diroutputfile
39
40
41tarcmd=tar
42taroptions="--format=posix -W -cf"
43
44cd $dirinputfile
45
46set_local="tar_full_simul.local"
47for file in $( cat $PATH_SIMU/tar_full_simul.list ) ; do
48    basename $file >> "tar_full_simul.local" 
49done
50
51$tarcmd $taroptions $outputfile --dereference --files-from tar_full_simul.local
52echo "====> TAR full simulation ${JobName}" 
53rm -f tar_full_simul.local
Note: See TracBrowser for help on using the repository browser.