[547] | 1 | #-Q- cesium #!/bin/ksh |
---|
| 2 | #-Q- cesium ###################### |
---|
| 3 | #-Q- cesium ## CESIUM CEA ## |
---|
| 4 | #-Q- cesium ###################### |
---|
| 5 | #-Q- cesium #MSUB -r PACKRESTART # Nom du job |
---|
| 6 | #-Q- cesium #MSUB -N 1 # Reservation du noeud |
---|
| 7 | #-Q- cesium #MSUB -n 1 # Reservation du processus |
---|
| 8 | #-Q- cesium #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 9 | #-Q- cesium #MSUB -E "-j o" |
---|
| 10 | #-Q- cesium #MSUB -E "-S /bin/ksh" |
---|
| 11 | #-Q- platine #!/usr/bin/ksh |
---|
| 12 | #-Q- platine ################### |
---|
| 13 | #-Q- platine ## PLATINE CEA ## |
---|
| 14 | #-Q- platine ################### |
---|
| 15 | #-Q- platine #BSUB -J PACKRESTART # Nom du job |
---|
| 16 | #-Q- platine #BSUB -N # message a la fin du job |
---|
| 17 | #-Q- platine #BSUB -n 1 # reservation des processeurs pour le job |
---|
| 18 | #-Q- platine #BSUB -W 4:00 # Limite temps |
---|
| 19 | #-Q- platine #BSUB -q post # Passage en queue post |
---|
| 20 | #-Q- platine #BSUB -L /bin/ksh |
---|
| 21 | #-Q- sx8brodie #!/bin/ksh |
---|
| 22 | #-Q- sx8brodie ####################### |
---|
| 23 | #-Q- sx8brodie ## SX8BRODIE IDRIS ## |
---|
| 24 | #-Q- sx8brodie ####################### |
---|
| 25 | #-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 26 | #-Q- sx8brodie # @ wall_clock_limit = 10:00:00 |
---|
| 27 | #-Q- sx8brodie # Nom du travail LoadLeveler |
---|
| 28 | #-Q- sx8brodie # @ job_name = PACKRESTART |
---|
| 29 | #-Q- sx8brodie # Fichier de sortie standard du travail |
---|
| 30 | #-Q- sx8brodie # @ output = $(job_name).$(jobid) |
---|
| 31 | #-Q- sx8brodie # Fichier de sortie d'erreur du travail |
---|
| 32 | #-Q- sx8brodie # @ error = $(job_name).$(jobid) |
---|
| 33 | #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 34 | #-Q- sx8brodie # @ notification = error |
---|
| 35 | #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER |
---|
| 36 | #-Q- sx8brodie # @ queue |
---|
| 37 | #-Q- aix6 #!/bin/ksh |
---|
| 38 | #-Q- aix6 ####################### |
---|
| 39 | #-Q- aix6 ## VARGAS IDRIS ## |
---|
| 40 | #-Q- aix6 ####################### |
---|
| 41 | #-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 42 | #-Q- aix6 # @ wall_clock_limit = 10:00:00 |
---|
| 43 | #-Q- aix6 # Nom du travail LoadLeveler |
---|
| 44 | #-Q- aix6 # @ job_name = PACKRESTART |
---|
| 45 | #-Q- aix6 # Fichier de sortie standard du travail |
---|
| 46 | #-Q- aix6 # @ output = $(job_name).$(jobid) |
---|
| 47 | #-Q- aix6 # Fichier de sortie d'erreur du travail |
---|
| 48 | #-Q- aix6 # @ error = $(job_name).$(jobid) |
---|
| 49 | #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 50 | #-Q- aix6 # @ notification = error |
---|
| 51 | #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER |
---|
| 52 | #-Q- aix6 # @ queue |
---|
| 53 | #-Q- ulam #!/bin/ksh |
---|
| 54 | #-Q- ulam ####################### |
---|
| 55 | #-Q- ulam ## VARGAS IDRIS ## |
---|
| 56 | #-Q- ulam ####################### |
---|
| 57 | #-Q- ulam # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 58 | #-Q- ulam # @ wall_clock_limit = 10:00:00 |
---|
| 59 | #-Q- ulam # Nom du travail LoadLeveler |
---|
| 60 | #-Q- ulam # @ job_name = PACKRESTART |
---|
| 61 | #-Q- ulam # Fichier de sortie standard du travail |
---|
| 62 | #-Q- ulam # @ output = $(job_name).$(jobid) |
---|
| 63 | #-Q- ulam # Fichier de sortie d'erreur du travail |
---|
| 64 | #-Q- ulam # @ error = $(job_name).$(jobid) |
---|
| 65 | #-Q- ulam # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 66 | #-Q- ulam # @ notification = error |
---|
| 67 | #-Q- ulam # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER |
---|
| 68 | #-Q- ulam # @ queue |
---|
| 69 | #-Q- sx8mercure #!/bin/ksh |
---|
| 70 | #-Q- sx8mercure ###################### |
---|
| 71 | #-Q- sx8mercure ## SX8MERCURE CEA ## |
---|
| 72 | #-Q- sx8mercure ###################### |
---|
| 73 | #-Q- sx8mercure #PBS -N PACKRESTART # Nom du job |
---|
| 74 | #-Q- sx8mercure #PBS -j o # regroupement des stdout et stderr |
---|
| 75 | #-Q- sx8mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
| 76 | #-Q- sx8mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
| 77 | #-Q- sx8mercure #PBS -l cputim_job=24:00:00 # Limite temps a 1 heures |
---|
| 78 | #-Q- sx8mercure #PBS -q scalaire |
---|
| 79 | #-Q- sx9mercure #!/bin/ksh |
---|
| 80 | #-Q- sx9mercure ###################### |
---|
| 81 | #-Q- sx9mercure ## CESIUM CEA ## |
---|
| 82 | #-Q- sx9mercure ###################### |
---|
| 83 | #-Q- sx9mercure #MSUB -r PACKRESTART # Nom du job |
---|
| 84 | #-Q- sx9mercure #MSUB -N 1 # Reservation du noeud |
---|
| 85 | #-Q- sx9mercure #MSUB -n 1 # Reservation du processus |
---|
| 86 | #-Q- sx9mercure #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 87 | #-Q- sx9mercure #MSUB -E "-j o" |
---|
| 88 | #-Q- sx9mercure #MSUB -E "-S /bin/ksh" |
---|
| 89 | #-Q- titane #!/bin/ksh |
---|
| 90 | #-Q- titane ###################### |
---|
| 91 | #-Q- titane ## TITANE CEA ## |
---|
| 92 | #-Q- titane ###################### |
---|
| 93 | #-Q- titane #MSUB -r PACKRESTART # Nom du job |
---|
| 94 | #-Q- titane #MSUB -eo |
---|
| 95 | #-Q- titane #MSUB -n 1 # Reservation du processus |
---|
| 96 | #-Q- titane #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 97 | #-Q- titane #MSUB -q mono |
---|
| 98 | #-Q- lxiv8 ###################### |
---|
| 99 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
| 100 | #-Q- lxiv8 ###################### |
---|
| 101 | #-Q- lxiv8 #PBS -N PACKRESTART |
---|
| 102 | #-Q- lxiv8 #PBS -m a |
---|
| 103 | #-Q- lxiv8 #PBS -j oe |
---|
| 104 | #-Q- lxiv8 #PBS -q medium |
---|
| 105 | #-Q- lxiv8 #PBS -o PACKRESTART.$$ |
---|
| 106 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
| 107 | #-Q- default #!/bin/ksh |
---|
| 108 | #-Q- default ################## |
---|
| 109 | #-Q- default ## DEFAULT HOST ## |
---|
| 110 | #-Q- default ################## |
---|
| 111 | |
---|
| 112 | #************************************************************** |
---|
| 113 | # Author: Sebastien Denvil |
---|
| 114 | # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr |
---|
| 115 | # $Revision:: $ Revision of last commit |
---|
| 116 | # $Author:: $ Author of last commit |
---|
| 117 | # $Date:: $ Date of last commit |
---|
| 118 | # IPSL (2006) |
---|
| 119 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
| 120 | # |
---|
| 121 | #************************************************************** |
---|
| 122 | |
---|
| 123 | #set -eu |
---|
| 124 | #set -vx |
---|
| 125 | |
---|
| 126 | date |
---|
| 127 | |
---|
| 128 | ######################################################################## |
---|
| 129 | |
---|
| 130 | #D- Flag to determine if this job in a standalone mode |
---|
| 131 | #D- Default : value from AA_job if any |
---|
| 132 | StandAlone=${StandAlone:=true} |
---|
| 133 | |
---|
| 134 | #D- Flag to determine begin date for restart pack |
---|
| 135 | #D- Default : value from AA_job if any |
---|
| 136 | DateBegin=20000101 |
---|
| 137 | |
---|
| 138 | #D- Flag to determine end date for restart pack |
---|
| 139 | #D- Default : value from AA_job if any |
---|
| 140 | DateEnd=20691231 |
---|
| 141 | |
---|
| 142 | #D- Flag to determine pack period |
---|
| 143 | #D- Default : value from AA_job if any |
---|
| 144 | period_pack=${period_pack:=10Y} |
---|
| 145 | |
---|
| 146 | SUBMIT_DIR=${PWD} |
---|
| 147 | |
---|
| 148 | RUN_DIR_PATH=/scratch/cont003/p86denv/Pack_Test |
---|
| 149 | |
---|
| 150 | #-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer. |
---|
| 151 | MASTER=${MASTER:=mercure|titane|brodie|vargas} |
---|
| 152 | |
---|
| 153 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 154 | #D- Default : value from AA_job if any |
---|
| 155 | libIGCM=${libIGCM:=/work/cont003/p86denv/PARA_XEON_CM5_IPSLCM5A.16122011_39L/modipsl/libIGCM} |
---|
| 156 | |
---|
| 157 | # WARNING for StandAlone use : To run this script on some machine, |
---|
| 158 | # you must check MirrorlibIGCM variable in sys library. |
---|
| 159 | # If this variable is true, you must use libIGCM_POST path instead |
---|
| 160 | # of your running libIGCM directory. |
---|
| 161 | |
---|
| 162 | #D- Increased verbosity (1, 2, 3) |
---|
| 163 | #D- Default : value from AA_job if any |
---|
| 164 | Verbosity=${Verbosity:=3} |
---|
| 165 | |
---|
| 166 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 167 | #D- Default : value from AA_job if any |
---|
| 168 | DEBUG_debug=${DEBUG_debug:=false} |
---|
| 169 | |
---|
| 170 | #on veut archiver les fichiers restart |
---|
| 171 | #Dans le cadre du demenagement ils seront renommes |
---|
| 172 | #ATM/Restart/****.nc |
---|
| 173 | #OCE/Restart/****.nc |
---|
| 174 | #... |
---|
| 175 | #sous la forme |
---|
| 176 | #RESTART/ATM_****.nc |
---|
| 177 | #RESTART/OCE_****.nc |
---|
| 178 | #Attention de bien conserver les dates d'origines |
---|
| 179 | # |
---|
| 180 | #Dans le cadre de la production nouvelle chaine |
---|
| 181 | #ils auront directement le bon nom |
---|
| 182 | # |
---|
| 183 | #On veut egalement que l'archive soit par periode de temps |
---|
| 184 | # cette periode est definie par la taille du pack donc connue |
---|
| 185 | # en entree du script (1M, 1Y, 5Y, 10Y etc...) |
---|
| 186 | # |
---|
| 187 | # $1= PATH/config_card d'une simulation avec |
---|
| 188 | # TagName/JobName/ExperimentName/SpaceName/DateBegin/DateEnd/PATH_SIMUL |
---|
| 189 | # $2=period_pack en M/m ou Y/y |
---|
| 190 | |
---|
| 191 | ######################################################################## |
---|
| 192 | |
---|
| 193 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 194 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 195 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 196 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 197 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 198 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
| 199 | #------- |
---|
| 200 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
| 201 | . ${libIGCM}/libIGCM_post/libIGCM_post.ksh |
---|
| 202 | |
---|
| 203 | ######################################################################## |
---|
| 204 | |
---|
| 205 | #set -vx |
---|
| 206 | |
---|
| 207 | RUN_DIR=${RUN_DIR_PATH} |
---|
| 208 | IGCM_sys_MkdirWork ${RUN_DIR} |
---|
| 209 | IGCM_sys_Cd ${RUN_DIR} |
---|
| 210 | |
---|
| 211 | # ------------------------------------------------------------------ |
---|
| 212 | # Test if all was right before proceeding further |
---|
| 213 | # ------------------------------------------------------------------ |
---|
| 214 | IGCM_debug_Verif_Exit_Post |
---|
| 215 | |
---|
| 216 | if [ ${StandAlone} = true ] ; then |
---|
| 217 | CARD_DIR=${SUBMIT_DIR} |
---|
| 218 | else |
---|
| 219 | CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} ) |
---|
| 220 | IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH} |
---|
| 221 | fi |
---|
| 222 | |
---|
| 223 | # |
---|
| 224 | # First of all |
---|
| 225 | # |
---|
| 226 | #### 0- lecture de config.card |
---|
| 227 | #### on veut les renseignements suivants : |
---|
| 228 | #### JobName, PATH_SIMUL, DateBegin et DateEnd |
---|
| 229 | |
---|
| 230 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card UserChoices |
---|
| 231 | typeset option |
---|
| 232 | for option in ${config_UserChoices[*]} ; do |
---|
| 233 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option} |
---|
| 234 | done |
---|
| 235 | # |
---|
| 236 | echo |
---|
| 237 | IGCM_debug_Print 1 "DefineArrayFromOption : config_UserChoices" |
---|
| 238 | IGCM_debug_PrintVariables 3 config_UserChoices_JobName |
---|
| 239 | IGCM_debug_PrintVariables 3 config_UserChoices_LongName |
---|
| 240 | IGCM_debug_PrintVariables 3 config_UserChoices_TagName |
---|
| 241 | IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName |
---|
| 242 | IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName |
---|
| 243 | IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType |
---|
| 244 | IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin |
---|
| 245 | IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd |
---|
| 246 | IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength |
---|
| 247 | echo |
---|
| 248 | |
---|
| 249 | #==================================================== |
---|
| 250 | #R_SAVE : Job output storage directory |
---|
| 251 | #R_BUFR : Job output buffered directory |
---|
| 252 | |
---|
| 253 | if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then |
---|
| 254 | FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' ) |
---|
| 255 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName} |
---|
| 256 | R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName} |
---|
| 257 | else |
---|
| 258 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 259 | R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 260 | fi |
---|
| 261 | IGCM_sys_TestDirArchive ${R_SAVE} |
---|
| 262 | [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive" |
---|
| 263 | |
---|
| 264 | #### Preparation de l'environnement |
---|
| 265 | # repertoire dans lequel seront crees les archives |
---|
| 266 | #STORE_RESTART=${R_SAVE}/RESTART |
---|
| 267 | #IGCM_sys_MkdirArchive ${STORE_RESTART} |
---|
| 268 | |
---|
| 269 | STORE_RESTART=/scratch/cont003/p86denv/Pack_Test/RESTART |
---|
| 270 | mkdir -p ${STORE_RESTART} |
---|
| 271 | |
---|
| 272 | #### 0- lecture de config.card |
---|
| 273 | #### on veut les renseignements suivants : |
---|
| 274 | #### JobName, PATH_SIMUL, DateBegin et DateEnd |
---|
| 275 | |
---|
| 276 | JobName=${config_UserChoices_JobName} |
---|
| 277 | #DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) |
---|
| 278 | #DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) |
---|
| 279 | PATH_SIMUL=${R_BUFR} |
---|
| 280 | echo $JobName $PATH_SIMUL $DateBegin $DateEnd |
---|
| 281 | |
---|
| 282 | #### 1- renommer les fichiers ###### |
---|
| 283 | #cd ${STORE_RESTART} |
---|
| 284 | #rm -rf * |
---|
| 285 | |
---|
| 286 | # On les copie sur le scratchdir en changeant le nom et conservant la date |
---|
| 287 | # Clear txt file lists |
---|
| 288 | rm -f ${RUN_DIR}/liste_restart_files.txt |
---|
| 289 | rm -f ${RUN_DIR}/new_liste_restart_files.txt |
---|
| 290 | rm -f ${RUN_DIR}/liste_pack_*.txt |
---|
| 291 | |
---|
| 292 | # Create sorted restart list to work with |
---|
| 293 | find ${PATH_SIMUL}/*/Restart -name "*nc" | sort >> ${RUN_DIR}/liste_restart_files.txt |
---|
| 294 | #sort ${RUN_DIR}/liste_restart_files.txt > ${RUN_DIR}/tmp.txt |
---|
| 295 | #mv ${RUN_DIR}/tmp.txt ${RUN_DIR}/liste_restart_files.txt |
---|
| 296 | |
---|
| 297 | ###cat ${RUN_DIR}/liste_restart_files.txt | xargs dmget |
---|
| 298 | |
---|
| 299 | # Rename restart files we will work with |
---|
| 300 | #gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("cp --preserve " $0 " "dest_name)}' ${RUN_DIR}/liste_restart_files.txt |
---|
| 301 | gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${RUN_DIR}/liste_restart_files.txt |
---|
| 302 | |
---|
| 303 | # List renamed restart files |
---|
| 304 | ls -l ${RUN_DIR}/*.nc > ${RUN_DIR}/new_liste_restart_files.txt |
---|
| 305 | |
---|
| 306 | ### 2- creer les listes de fichiers par periode #### |
---|
| 307 | ###Â 2.1- dechiffrer period_pack et le separer en year et month ### |
---|
| 308 | case ${period_pack} in |
---|
| 309 | *Y|*y) |
---|
| 310 | periodpackinyear=$( echo ${period_pack} | sed -e 's/[yY]//' ) |
---|
| 311 | periodpackinmonth=0 |
---|
| 312 | ;; |
---|
| 313 | |
---|
| 314 | *M|*m) |
---|
| 315 | periodpackinyear=0 |
---|
| 316 | periodpackinmonth=$( echo ${period_pack} | sed -e 's/[mM]//' ) |
---|
| 317 | ;; |
---|
| 318 | |
---|
| 319 | *) |
---|
| 320 | echo "period_pack doit etre en mois ou annees" |
---|
| 321 | IGCM_debug_Exit "period pack unit" |
---|
| 322 | ;; |
---|
| 323 | |
---|
| 324 | esac |
---|
| 325 | |
---|
| 326 | ### 2.2- extraire l'annee et le mois de DateBegin ### |
---|
| 327 | date_begin=${DateBegin} |
---|
| 328 | date_end=${DateEnd} |
---|
| 329 | |
---|
| 330 | IGCM_date_GetYearMonth ${date_begin} year_begin month_begin |
---|
| 331 | IGCM_date_GetYearMonth ${date_end} year_end month_end |
---|
| 332 | |
---|
| 333 | # ------------------------------------------------------------------ |
---|
| 334 | # Test if all was right before proceeding further |
---|
| 335 | # ------------------------------------------------------------------ |
---|
| 336 | IGCM_debug_Verif_Exit_Post |
---|
| 337 | |
---|
| 338 | ### 2.3- creation des listes ### |
---|
| 339 | date_begin_pack=${date_begin} |
---|
| 340 | month_begin_pack=${month_begin} |
---|
| 341 | year_begin_pack=${year_begin} |
---|
| 342 | |
---|
| 343 | date_end_simulation=${date_end} |
---|
| 344 | |
---|
| 345 | number_pack=1 |
---|
| 346 | |
---|
| 347 | IGCM_debug_PrintVariables 3 date_begin_pack |
---|
| 348 | IGCM_debug_PrintVariables 3 date_end_simulation |
---|
| 349 | |
---|
| 350 | while [ ${date_begin_pack} -le ${date_end_simulation} ] ; do |
---|
| 351 | |
---|
| 352 | IGCM_debug_PrintVariables 3 number_pack |
---|
| 353 | |
---|
| 354 | (( month_end_pack = month_begin_pack + periodpackinmonth )) |
---|
| 355 | (( add_year = ${month_end_pack} / 13 )) |
---|
| 356 | if [ ${month_end_pack} -ge 13 ] ; then |
---|
| 357 | (( month_end_pack = ${month_end_pack} % 12 )) |
---|
| 358 | fi |
---|
| 359 | |
---|
| 360 | (( year_end_pack = year_begin_pack + periodpackinyear + add_year )) |
---|
| 361 | |
---|
| 362 | date_end_pack=${year_end_pack}$( printf "%02i\n" ${month_end_pack} )01 |
---|
| 363 | |
---|
| 364 | for file in $( gawk '{print $9}' ${RUN_DIR}/new_liste_restart_files.txt ); do |
---|
| 365 | extract_date_file=$( echo ${file} | sed -e "s/.*${JobName}_//" ) |
---|
| 366 | date_file=$( echo ${extract_date_file} | sed 's/\([0-9]\{8\}\)_.*$/\1/g' ) |
---|
| 367 | # echo pack n°${number_pack} ${date_file} ${date_begin_pack} ${date_end_pack} |
---|
| 368 | if [ ${date_file} -lt ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then |
---|
| 369 | echo $( basename ${file} ) >> ${RUN_DIR}/liste_pack_${number_pack}.txt |
---|
| 370 | # elif [ ${date_file} -ge ${date_end_pack} ] ; then |
---|
| 371 | # break |
---|
| 372 | fi |
---|
| 373 | done |
---|
| 374 | |
---|
| 375 | month_begin_pack=${month_end_pack} |
---|
| 376 | year_begin_pack=${year_end_pack} |
---|
| 377 | date_begin_pack=${year_begin_pack}$( printf "%02i\n" ${month_begin_pack} )01 |
---|
| 378 | |
---|
| 379 | tar -cvf ${STORE_RESTART}/restart_pack_${number_pack}.tar --dereference --files-from ${RUN_DIR}/liste_pack_${number_pack}.txt |
---|
| 380 | cat ${RUN_DIR}/liste_pack_${number_pack}.txt | xargs rm |
---|
| 381 | mv ${RUN_DIR}/liste_pack_${number_pack}.txt ${STORE_RESTART} |
---|
| 382 | |
---|
| 383 | (( number_pack = number_pack + 1 )) |
---|
| 384 | |
---|
| 385 | done |
---|