- Timestamp:
- 04/19/23 11:21:58 (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/AA_clean_or_continue
r1575 r1583 37 37 echo "" 38 38 echo "clean_or_continue.job " 39 if [ $# -gt 0 ] ; then 39 40 # Read arguments 41 print_help=no 42 force_rm=no 43 while (($# > 0)) ; do 44 case $1 in 45 "-h") 46 print_help=yes ; shift ;; 47 48 "-f") 49 force_rm=yes ; shift ;; 50 *) 51 echo "Unknown option "$1" . Use -h for help." 52 exit 53 esac 54 done 55 56 57 if [ $print_help == yes ] ; then 40 58 # Print help and exit 41 59 echo "" 42 60 echo "The script is called from in the your experiment directory, the so-called SUBMIT_DIR, in the following way" 43 echo "../../../libIGCM/clean_or_continue.job -h : to print following information" 44 echo "../../../libIGCM/clean_or_continue.job : normal execution" 61 echo "../../../libIGCM/clean_or_continue.job : normal execution, you'll be asked before files are deleted" 62 echo "../../../libIGCM/clean_or_continue.job -f : force normal execution to delete files without asking" 63 echo "../../../libIGCM/clean_or_continue.job -h : print following information" 45 64 echo "" 46 65 echo "This script can be used for 3 cases:" … … 62 81 exit 63 82 fi 64 echo "" 65 echo "This script needs to delete files to work correctly. Therefore you should answer yes to the questions." 66 echo "Use ../../../libIGCM/clean_or_contine.job -h for more information" 67 echo "" 83 84 if [ $force_rm == yes ] ; then 85 echo "" 86 echo "Option -f to delete files without asking is set" 87 else 88 echo "" 89 echo "This script needs to delete files to work correctly. Therefore you should answer yes to the questions." 90 echo "Use ../../../libIGCM/clean_or_contine.job -h for more information" 91 echo "" 92 fi 68 93 69 94 #D--------------------------------------------------------------------== … … 124 149 # 125 150 if [ X${run_Configuration_CumulPeriod} = X ] ; then 126 echo -e "\033[1;32mCumulPeriod is empty so we want to erase run.card to start properly. Do you want that?" 127 echo -n -e " Your answer (y/n) : \033[m" 128 read reponse 151 if [ $force_rm == yes ] ; then 152 echo -e "\033[1;32mCumulPeriod is empty so run.card will be deleted to start properly. " 153 reponse=yes 154 else 155 echo -e "\033[1;32mCumulPeriod is empty so we want to erase run.card to start properly. Do you want that?" 156 echo -n -e " Your answer (y/n) : \033[m" 157 read reponse 158 fi 129 159 case ${reponse} in 130 160 131 161 oui|OUI|o|y|yes|YES) 132 echo " OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."162 echo "Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}" 133 163 IGCM_sys_Rm ${SUBMIT_DIR}/run.card 134 164 ;; … … 171 201 done 172 202 fi 173 echo -e "\033[1;32mDo you REALLY want to erase all those files ?" 174 echo -n -e " Your answer (y/n) : \033[m" 175 read reponse 176 case ${reponse} in 177 178 oui|OUI|o|y|yes|YES) 179 echo "OK. It will be erased." 203 if [ $force_rm == yes ] ; then 204 reponse=y 205 else 206 echo -e "\033[1;32mDo you REALLY want to erase all those files ?" 207 echo -n -e " Your answer (y/n) : \033[m" 208 read reponse 209 fi 210 case ${reponse} in 211 212 oui|OUI|o|y|yes|YES) 213 echo "The files will be erased." 180 214 IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" -exec rm -f '{}' \;" 181 215 if [ X${Pack} = Xtrue ] ; then … … 196 230 done 197 231 198 echo -e "\033[1;32mDo you REALLY want to erase all those Directories ?" 199 echo -n -e " Your answer (y/n) : \033[m" 200 read reponse 201 case ${reponse} in 202 203 oui|OUI|o|y|yes|YES) 204 echo "OK. It will be erased." 232 if [ $force_rm == yes ] ; then 233 reponse=y 234 else 235 echo -e "\033[1;32mDo you REALLY want to erase all those Directories ?" 236 echo -n -e " Your answer (y/n) : \033[m" 237 read reponse 238 fi 239 case ${reponse} in 240 241 oui|OUI|o|y|yes|YES) 242 echo "The files will be erased." 205 243 find ${REBUILD_DIR} -type d -name "*${PeriodDateBegin}*" -exec rm -Rf '{}' \; 206 244 echo "done." … … 215 253 if ( [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then 216 254 217 echo -e "\033[1;32mNOW do you want to continue the simulation (Set PeriodState=OnQueue into run.card) ?" 218 echo -n -e " Your answer (y/n) : \033[m" 219 read reponse 220 case ${reponse} in 221 222 oui|OUI|o|y|yes|YES) 223 echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}." 255 if [ $force_rm == yes ] ; then 256 echo -e "\033[1;32mPeriodState=OnQueue is set in run.card)" 257 reponse=y 258 else 259 echo -e "\033[1;32mNOW do you want to continue the simulation (Set PeriodState=OnQueue into run.card) ?" 260 echo -n -e " Your answer (y/n) : \033[m" 261 read reponse 262 fi 263 case ${reponse} in 264 265 oui|OUI|o|y|yes|YES) 266 echo "You can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}" 224 267 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue" 225 268 ;; … … 229 272 esac 230 273 else 231 echo "You can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ."274 echo "You can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}" 232 275 fi 233 276 234 277 if [ X${run_Configuration_CumulPeriod} = X1 ] ; then 235 echo -e "\033[1;32mCumulPeriod=1 so we want to erase run.card to start properly. Do you want that too?" 236 echo -n -e " Your answer (y/n) : \033[m" 237 read reponse 238 case ${reponse} in 239 240 oui|OUI|o|y|yes|YES) 241 echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}." 278 if [ $force_rm == yes ] ; then 279 echo -e "\033[1;32mCumulPeriod=1 and therfor run.card is deleted to start properly." 280 reponse=y 281 else 282 echo -e "\033[1;32mCumulPeriod=1 so we want to erase run.card to start properly. Do you want that too?" 283 echo -n -e " Your answer (y/n) : \033[m" 284 read reponse 285 fi 286 case ${reponse} in 287 288 oui|OUI|o|y|yes|YES) 289 echo "You can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}" 242 290 IGCM_sys_Rm ${SUBMIT_DIR}/run.card 243 291 ;; … … 252 300 Script_Output=${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${run_Configuration_CumulPeriod} ) 253 301 254 echo -e "\033[1;32mDo you want to change the number in Script_Output? (${Script_Output} into Job) ?" 255 echo -n -e " Your answer (y/n) : \033[m" 256 read reponse 302 if [ $force_rm == yes ] ; then 303 echo -e "\033[1;32mThe number in the jobname in Script_Output is changed." 304 reponse=y 305 else 306 echo -e "\033[1;32mDo you want to change the number in Script_Output? (${Script_Output} into Job) ?" 307 echo -n -e " Your answer (y/n) : \033[m" 308 read reponse 309 fi 257 310 case ${reponse} in 258 311
Note: See TracChangeset
for help on using the changeset viewer.