Commit dffaeeba authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Simplified syntax

ref #1
parent 581d0059
...@@ -174,7 +174,7 @@ fi ...@@ -174,7 +174,7 @@ fi
# Option ContinueFrom # Option ContinueFrom
# #
#################### ####################
if [[ -f ${RESIFDD_CONTINUE_FROM_FILE} ]]; then if [[ -r ${RESIFDD_CONTINUE_FROM_FILE} ]]; then
# Continue from previous report # Continue from previous report
echo "Recovery file $RESIFDD_CONTINUE_FROM_FILE exists" echo "Recovery file $RESIFDD_CONTINUE_FROM_FILE exists"
cp $RESIFDD_CONTINUE_FROM_FILE $RESIFDD_WORKDIR/recovery.$$ cp $RESIFDD_CONTINUE_FROM_FILE $RESIFDD_WORKDIR/recovery.$$
...@@ -185,7 +185,7 @@ else ...@@ -185,7 +185,7 @@ else
fi fi
# Header for the report : # Header for the report :
IRODS_REPORT=reports/$(date +%Y-%m-%d).csv IRODS_REPORT=reports/$(date +%Y%m%d-%H%M).csv
LOCAL_REPORT=$RESIFDD_WORKDIR/report.csv LOCAL_REPORT=$RESIFDD_WORKDIR/report.csv
format_report "Year_Network_Station" "Size(MB)" "Dumpdate" "Duration(s)" "Throughput(MB/s)" "Comment" > $LOCAL_REPORT format_report "Year_Network_Station" "Size(MB)" "Dumpdate" "Duration(s)" "Throughput(MB/s)" "Comment" > $LOCAL_REPORT
imkdir -p reports imkdir -p reports
...@@ -198,7 +198,7 @@ iput -f $LOCAL_REPORT $IRODS_REPORT ...@@ -198,7 +198,7 @@ iput -f $LOCAL_REPORT $IRODS_REPORT
################## ##################
KEY="validated-seismic-metadata" KEY="validated-seismic-metadata"
if [ ! -z "${RECOVERY_FILE+x}" ] && egrep -q -e ".*($KEY ).*( OK | Skipped ).*" $RECOVERY_FILE ; then if [[ -r $RECOVERY_FILE ]] && egrep -q -e ".*($KEY ).*( OK | Skipped ).*" $RECOVERY_FILE ; then
format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S --date=@$start) "-" "-" "Skipped" >> $LOCAL_REPORT format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S --date=@$start) "-" "-" "Skipped" >> $LOCAL_REPORT
else else
# Get the snapshot name for this month # Get the snapshot name for this month
...@@ -245,7 +245,7 @@ for dir in $(find . -maxdepth 3 -type d | sort); do ...@@ -245,7 +245,7 @@ for dir in $(find . -maxdepth 3 -type d | sort); do
NETWORK=${YNS[2]} NETWORK=${YNS[2]}
STATION=${YNS[3]} STATION=${YNS[3]}
# Test if in recovery mode, we should send or not # Test if in recovery mode, we should send or not
if [ ! -z "${RECOVERY_FILE+x}" ]; then if [[ -r $RECOVERY_FILE ]]; then
if egrep -q -e ".*$YEAR.*$NETWORK.*$STATION.*( OK | Skipped ).*" $RECOVERY_FILE; then if egrep -q -e ".*$YEAR.*$NETWORK.*$STATION.*( OK | Skipped ).*" $RECOVERY_FILE; then
echo "Found OK or skipped in $RECOVERY_FILE for $KEY. Skipping" echo "Found OK or skipped in $RECOVERY_FILE for $KEY. Skipping"
format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S --date=@$start) "-" "-" "Skipped" >> $LOCAL_REPORT format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S --date=@$start) "-" "-" "Skipped" >> $LOCAL_REPORT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment