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