- Timestamp:
- 09/13/12 15:37:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/archive_debug.sh
r1875 r1878 63 63 grep ${PATH_SIMUL_FULL} ${LISTE_DMNFS} | grep Debug | awk '{print $3}' | sed '/^.*Debug$/d' >> ${IGCM_TMP}/${$}.liste_debug_files.txt 64 64 65 # Test si il y a un repertoire Debug 66 listDebugNbLines=`cat ${IGCM_TMP}/${$}.liste_debug_files.txt | wc -l ` 67 if [ "x${listDebugNbLines}" == "x0" ] 68 then 69 DEM_log -0 "Pas de repertoire Debug pour cette simulation" 70 else 71 65 72 # cas particulier : les fichiers Bands sont conserves sans etre archives 66 grep ${JobName}_Bands ${IGCM_TMP}/${$}.liste_debug_files.txt >> ${STORE_CP}/cp_files.list67 sed "/${JobName}_Bands/d" ${IGCM_TMP}/${$}.liste_debug_files.txt > ${IGCM_TMP}/${$}.liste_debug_files.txt_tmp68 mv ${IGCM_TMP}/${$}.liste_debug_files.txt_tmp ${IGCM_TMP}/${$}.liste_debug_files.txt69 70 gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${IGCM_TMP}/${$}.liste_debug_files.txt73 grep ${JobName}_Bands ${IGCM_TMP}/${$}.liste_debug_files.txt >> ${STORE_CP}/cp_files.list 74 sed "/${JobName}_Bands/d" ${IGCM_TMP}/${$}.liste_debug_files.txt > ${IGCM_TMP}/${$}.liste_debug_files.txt_tmp 75 mv ${IGCM_TMP}/${$}.liste_debug_files.txt_tmp ${IGCM_TMP}/${$}.liste_debug_files.txt 76 77 gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${IGCM_TMP}/${$}.liste_debug_files.txt 71 78 72 79 #on fait de meme avec les fichiers out_gcm.e stockes dans le repertoire Out/ qui seront prefixes par Out_ 73 rm -f ${IGCM_TMP}/${$}.liste_debug_files.txt74 grep ${PATH_SIMUL_FULL} ${LISTE_DMNFS} | grep -w Out | awk '{print $3}' | sed '/^.*Out$/d' > ${IGCM_TMP}/${$}.liste_debug_files.txt75 gawk -F/ '{dest_name=$(NF-1)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${IGCM_TMP}/${$}.liste_debug_files.txt80 rm -f ${IGCM_TMP}/${$}.liste_debug_files.txt 81 grep ${PATH_SIMUL_FULL} ${LISTE_DMNFS} | grep -w Out | awk '{print $3}' | sed '/^.*Out$/d' > ${IGCM_TMP}/${$}.liste_debug_files.txt 82 gawk -F/ '{dest_name=$(NF-1)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${IGCM_TMP}/${$}.liste_debug_files.txt 76 83 77 84 78 ls -l ${STORE_DEBUG} > ${IGCM_TMP}/${$}.new_liste_debug_files.txt85 ls -l ${STORE_DEBUG} > ${IGCM_TMP}/${$}.new_liste_debug_files.txt 79 86 80 87 ### 2- creer les listes de fichiers par periode #### 81 DEM_log -1 "Creation des listes de fichiers par periode"88 DEM_log -1 "Creation des listes de fichiers par periode" 82 89 ### 2.1- extraire l'annee et le mois de DateBegin ### 83 date_begin=${DateBegin}84 date_end=${DateEnd}90 date_begin=${DateBegin} 91 date_end=${DateEnd} 85 92 86 year_begin=$(echo ${date_begin} | cut -c 1-4 )87 month_begin=$(echo ${date_begin} | cut -c 5-6 )88 year_end=$(echo ${date_end} | cut -c 1-4 )89 month_end=$(echo ${date_end} | cut -c 5-6 )93 year_begin=$(echo ${date_begin} | cut -c 1-4 ) 94 month_begin=$(echo ${date_begin} | cut -c 5-6 ) 95 year_end=$(echo ${date_end} | cut -c 1-4 ) 96 month_end=$(echo ${date_end} | cut -c 5-6 ) 90 97 91 98 92 99 ### 2.2- creation des listes ### 93 date_begin_pack=${date_begin}94 date_end_simulation=${date_end}100 date_begin_pack=${date_begin} 101 date_end_simulation=${date_end} 95 102 96 month_begin_pack=${month_begin}97 year_begin_pack=${year_begin}103 month_begin_pack=${month_begin} 104 year_begin_pack=${year_begin} 98 105 99 number_pack=1106 number_pack=1 100 107 101 while [ ${date_begin_pack} -le ${date_end_simulation} ]102 do108 while [ ${date_begin_pack} -le ${date_end_simulation} ] 109 do 103 110 104 DEM_log -1 "On calcule la date de fin du pack "111 DEM_log -1 "On calcule la date de fin du pack " 105 112 106 107 113 month_end_pack=${month_begin_pack} 114 year_end_pack=`expr ${year_begin_pack} + ${period_pack}` 108 115 109 116 date_end_pack=${year_end_pack}${month_end_pack}01 110 117 111 112 113 114 115 118 if [ "x${ON_IDRIS}" == "xno" ] 119 then 120 for file in `awk '{print $9}' ${IGCM_TMP}/${$}.new_liste_debug_files.txt`; do 121 extract_date_file=`echo ${file} | sed -e "s/.*\${JobName}_//"` 122 date_file=`echo ${extract_date_file}| sed 's/\([0-9]\{8\}\)_.*$/\1/g'` 116 123 117 118 119 120 121 122 123 124 125 126 for file in `awk '{print $8}' ${IGCM_TMP}/${$}.new_liste_debug_files.txt`; do127 128 124 if [ ${date_file} -lt ${date_end_pack} ] 125 then 126 if [ ${date_file} -ge ${date_begin_pack} ] 127 then 128 echo ${file} >> ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt 129 fi 130 fi 131 done 132 else 133 for file in `awk '{print $8}' ${IGCM_TMP}/${$}.new_liste_debug_files.txt`; do 134 extract_date_file=`echo ${file} | sed -e "s/.*\${JobName}_//"` 135 date_file=`echo ${extract_date_file}| sed 's/\([0-9]\{8\}\)_.*$/\1/g'` 129 136 130 131 132 133 134 135 136 137 138 137 if [ ${date_file} -lt ${date_end_pack} ] 138 then 139 if [ ${date_file} -ge ${date_begin_pack} ] 140 then 141 echo ${file} >> ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt 142 fi 143 fi 144 done 145 fi 139 146 140 147 #on archive les debug - le nom de l'archive contiendra ${yearbegin}${monthbegin}_${yearend}${monthend} … … 166 173 done 167 174 175 fi 168 176 169 177 cd ${EXE_DIR}
Note: See TracChangeset
for help on using the changeset viewer.