#!/bin/bash # 1- faire un mv de la simu d'origine en JobName.BF (BF = Before Pack) # 2- copier sur le store la simu repackee sur Pseudo_dmnfs_store # 3- effacer dans JobName_BF les fichiers contenus dans les listes correctement traitees #---------------------------------------------------------------- #---------------------------------------------------------------- # On renseigne les variables d'environnement . load_ipslPack_env.sh export JOB_DIR=${TMP_MIGR_DATA} export EXE_DIR=${LS_SUBCWD:-${PWD}} SCRIPT_NAME=$(basename ${0} ) export IGCM_TMP="${IGCM_DEM}/tmp" # gpdebug : added export config_card=${IGCM_DEM}/config_card.liste source ${EXE_DIR}/DEM_utilities.sh #---------------------------------------------------------------- #---------------------------------------------------------------- # Gestion de l'option de lancement # si -R --> alors on active le stockage sur le store et le remove des anciennes donnees execRmv=0 forceDirect2Rmv=0 while [ $# -gt 0 ] do case $1 in -h) cat < liste_files.txt rmv_file_bis=${USER_OUTPUT_PROGRESS}/rmv_afterSurPack.txt rm -f ${rmv_file_bis} for removedfile in `awk '{print $0}' liste_files.txt`; do rmv_file=${removedfile} if [[ -f ${rmv_file_bis} ]] ; then cp ${rmv_file} ${rmv_file_bis} else cat ${rmv_file} >> ${rmv_file_bis} fi mkdir -p ${IGCM_DEM_SIMU}/restart_rmv rm -rf ${IGCM_DEM_SIMU}/restart_rmv/* for archive in `awk '{print $2}' ${IGCM_DEM_SIMU}/liste_restart_files_config.txt`; do not_rmv=0 ccc_hsm get $archive tar tf $archive > ${IGCM_DEM_SIMU}/restart_rmv/archive.rmv for fichier in `awk '{print $0}' ${IGCM_DEM_SIMU}/restart_rmv/archive.rmv`; do FindFile=`grep $fichier $rmv_file` if [ "X$FindFile" == "X" ]; then echo "$archive tar to be conserved" not_rmv=1 fi done if [ $not_rmv == 0 ] ; then echo "rm -f $archive" >> ${rmv_file_bis} fi rm -f ${IGCM_DEM_SIMU}/restart_rmv/archive.rmv done mkdir -p ${IGCM_DEM_SIMU}/debug_rmv rm -rf ${IGCM_DEM_SIMU}/debug_rmv/* for archive in `awk '{print $0}' ${IGCM_DEM_SIMU}/liste_debug_files_config.txt`; do not_rmv=0 ccc_hsm get $archive tar tf $archive > ${IGCM_DEM_SIMU}/debug_rmv/archive.rmv for fichier in `awk '{print $0}' ${IGCM_DEM_SIMU}/debug_rmv/archive.rmv`; do FindFile=`grep $fichier $rmv_file` if [ "X$FindFile" == "X" ]; then echo "$archive tar to be conserved" not_rmv=1 fi done if [ $not_rmv == 0 ] ; then echo "rm -f $archive" >> ${rmv_file_bis} fi rm -f ${IGCM_DEM_SIMU}/debug_rmv/archive.rmv done done sed -i -e "s%${SIMU}\/%${SIMU_BP}\/%g" ${rmv_file_bis} echo "grep ${JobName} ${rmv_file_bis} > ${rmv_file_bis}.tmp" grep ${JobName} ${rmv_file_bis} > ${rmv_file_bis}.tmp; mv ${rmv_file_bis}.tmp ${rmv_file_bis} chmod 755 ${rmv_file_bis} if [[ $execRmv == 1 ]] ; then # sauver l'ancienne version mv ${SIMU} ${SIMU_BP} #copier sur le store la nouvelle mv ${OUTPUT_STORE}${LITTLE_PATH} ${SIMU} #copie du repertoire Exe qui ne change pas mv ${SIMU_BP}/Exe ${SIMU}/. # effacer dans l'ancienne version les fichiers de rmv_file_bis ${rmv_file_bis} #creation de la liste des fichiers restant find ${SIMU_BP} -printf "%y %s %p \n" > ${USER_OUTPUT_PROGRESS}/lastFiles_afterSurPack.txt fi done