Skip to content

Commit 41b2450

Browse files
committed
fix file naming, cleanup
1 parent 9359ba0 commit 41b2450

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

doc/sphinx-guides/source/_static/util/counter_daily.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#! /bin/bash
2+
#counter_daily.sh
23

34
COUNTER_PROCESSOR_DIRECTORY="/usr/local/counter-processor-1.06"
45
MDC_LOG_DIRECTORY="/usr/local/payara6/glassfish/domains/domain1/logs/mdc"
56
COUNTER_PROCESSOR_TMP_DIRECTORY="/tmp"
67
# If you wish to keep the logs, use a directory that is not periodically cleaned, e.g.
78
#COUNTER_PROCESSOR_TMP_DIRECTORY="/usr/local/counter-processor-1.06/tmp"
89

9-
# counter_daily.sh
10-
1110
cd $COUNTER_PROCESSOR_DIRECTORY
1211

1312
echo >>$COUNTER_PROCESSOR_TMP_DIRECTORY/counter_daily.log
@@ -44,13 +43,14 @@ for report_file in $COUNTER_PROCESSOR_TMP_DIRECTORY/make-data-count-report.json.
4443
echo "Finished processing $report_file" >>$COUNTER_PROCESSOR_TMP_DIRECTORY/counter_daily.log
4544

4645
# Extract the base filename and the extension
47-
file_base=$(basename "$report_file" .json.*)
46+
file_base=$(basename "$report_file" | sed 's/\.json\..*//')
4847
file_ext=$(echo "$report_file" | sed -n 's/.*\.json\.\(.*\)/\1/p')
49-
48+
echo $file_base
49+
echo $file_ext
5050
# Remove the old file if it exists
51-
rm -f $COUNTER_PROCESSOR_TMP_DIRECTORY/${file_base}.json.${YEAR_MONTH}
52-
51+
rm -f $COUNTER_PROCESSOR_TMP_DIRECTORY/${file_base}.${YEAR_MONTH}.json.${file_ext}
52+
5353
# Move the processed file
54-
mv $report_file $COUNTER_PROCESSOR_TMP_DIRECTORY/${file_base}.json.${YEAR_MONTH}
54+
mv $report_file $COUNTER_PROCESSOR_TMP_DIRECTORY/${file_base}.${YEAR_MONTH}.json.${file_ext}
5555
fi
56-
done
56+
done

doc/sphinx-guides/source/_static/util/counter_weekly.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ done
4545

4646
}
4747

48-
# Call the function on the root dataverse to start processing
48+
# Call the function on the root dataverse to start processing
4949
processDV 1

0 commit comments

Comments
 (0)