source: TOOLS/PACK_IPSL/calcul_size_simul.sh @ 1709

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

Add tool pack used for ccrt/tgcc migration

File size: 1.1 KB
Line 
1#!/bin/bash
2
3
4#### On veut calculer si l'ensemble des fichiers d'une simulation
5#### est bien superieur a 1G
6
7config_card=${1}
8LISTE_DMNFS=${2}
9
10export JOB_DIR=${JOB_DIR:-${PWD}}
11export IGCM_DEM=${IGCM_DEM:-${SCRATCHDIR}/IGCM_DEM}
12export IGCM_TMP=${IGCM_TMP:-${IGCM_DEM}/tmp}
13mkdir -p ${IGCM_DEM}
14mkdir -p ${IGCM_TMP}
15
16eval $(grep JobName ${config_card}) 
17eval $(grep PATH_SIMUL_FULL ${config_card}) 
18eval $(grep DateBegin ${config_card}) 
19eval $(grep DateEnd ${config_card}) 
20eval $(grep IGCM_DEM_SIMU ${config_card})
21
22
23
24## 1 Go
25limitmin=1000000000
26
27#cree la liste de l'ensemble des fichiers de la simulation
28grep ${PATH_SIMUL_FULL} ${LISTE_DMNFS} | grep 'R ' > ${IGCM_TMP}/$$.info_tmp.txt
29awk '{print $(NF-2) " " $(NF-1)}' ${IGCM_TMP}/$$.info_tmp.txt > ${IGCM_DEM_SIMU}/All_files_simul.txt
30
31size=`awk 'BEGIN {y = 0} {x = $1 ; y = y + x } END{print y}'  ${IGCM_DEM_SIMU}/All_files_simul.txt`
32echo $size
33if [  ${size} -lt ${limitmin} ]
34then
35
36    echo "trop petit on archive cette simulation avec tar"
37    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/[^/]*/[^/]*/[^/]*/%%' )
38    echo  ${PATH_SIMUL_FULL} > ${IGCM_DEM_SIMU}/tar_full_simul.txt
39
40
41fi
Note: See TracBrowser for help on using the repository browser.