comparison save_logs.sh @ 0:7a7ba86e95a4 draft default tip

"planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
author climate
date Tue, 15 Jun 2021 09:39:23 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:7a7ba86e95a4
1 #!/usr/bin/env bash
2
3 WORKDIR=$1
4 LOGDIR=$2
5 INFO_FILE=$3
6
7 echo "===================================================================="
8 echo " Save logfiles from CESM run "
9 echo "===================================================================="
10
11 for log_type in atm cesm cpl lnd rof; do
12 nb=$(find $WORKDIR -type f -name "$log_type.log.*" | wc -l)
13 nbz=$(find $WORKDIR -type f -name "$log_type.log.*.gz" | wc -l)
14
15 if [[ $nb -gt 0 ]]; then
16 if [[ $nb -gt 0 ]]; then
17 gunzip $1/${log_type}.log.*.gz
18 fi
19 cat $1/${log_type}.* > $2/${log_type}_log.txt 2>>$INFO_FILE
20 fi
21 done
22
23 echo "Logfiles saved."