source: TOOLS/PACK_IPSL/calcul_size_simul.sh @ 1714

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

If a simulation has a size less than 1Go we tar it

File size: 1.3 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
16EXE_DIR=$(dirname ${0})
17SCRIPT_NAME=$(basename ${0} )
18source ${EXE_DIR}/DEM_utilities.sh
19DEM_log -0 "Demarrage de ${SCRIPT_NAME}"
20
21eval $(grep JobName ${config_card}) 
22eval $(grep PATH_SIMUL_FULL ${config_card}) 
23eval $(grep DateBegin ${config_card}) 
24eval $(grep DateEnd ${config_card}) 
25eval $(grep IGCM_DEM_SIMU ${config_card})
26
27
28
29## 1 Go
30limitmin=1000000000
31
32#cree la liste de l'ensemble des fichiers de la simulation
33#echo ${PATH_SIMUL_FULL} ${LISTE_DMNFS}
34grep ${PATH_SIMUL_FULL} ${LISTE_DMNFS} | grep 'f ' > ${IGCM_TMP}/$$.info_tmp.txt
35awk '{print $(NF-1) " " $(NF)}' ${IGCM_TMP}/$$.info_tmp.txt > ${IGCM_DEM_SIMU}/All_files_simul.txt
36
37size=`awk 'BEGIN {y = 0} {x = $1 ; y = y + x } END{print y}'  ${IGCM_DEM_SIMU}/All_files_simul.txt`
38DEM_log -3 "la taille de la simulation est  $size"
39if [  ${size} -lt ${limitmin} ]
40then
41
42    DEM_log -0  "Simulation < 1Go -  on l'archive avec tar"
43    ./write_liste_tar.sh ${config_card}
44
45fi
46DEM_log -0 "Fin de ${SCRIPT_NAME}"
Note: See TracBrowser for help on using the repository browser.