diff --git a/src/imrsrsv.py b/src/imrsrsv.py index 5f19bcc..4295106 100644 --- a/src/imrsrsv.py +++ b/src/imrsrsv.py @@ -149,7 +149,9 @@ def process_date(self, d): try: with open(date_tmp, "wt") as F: for s in this_slice: - F.write(join(self.cbor_instance, s) + "\n") + s_file = join(self.cbor_instance, s) + if os.path.getsize(s_file) > 0: + F.write(s_file + "\n") merge_cmp = self.cmd + ' -I ' + date_result + " " + date_tmp cmd_ret = os.system(merge_cmp) if cmd_ret == 0: diff --git a/src/ipstats.sh b/src/ipstats.sh index 21363bf..1c6f80c 100644 --- a/src/ipstats.sh +++ b/src/ipstats.sh @@ -5,6 +5,8 @@ IPSTATS_DIR="$HOME/ipstats" IMRS_CBOR=/data/ITHI/cbor/IMRS/ MONTH=202403 SCRIPT="$HOME/ithitools/src/imrsrsv.py" +RUN_DATE=$(date '%(%Y-%m-%d)T\n') +RUN_LOG=`tmp/$RUN_DATE.$$.txt` echo "Home: $HOME" echo "ithitools: $ITHITOOLS" @@ -12,5 +14,6 @@ echo "ipstats: $IPSTATS_DIR" echo "imrs: $IMRS_CBOR" echo "Month: $MONTH" echo "Script: $SCRIPT" +echo "Log: $RUN_LOG" -python3.6 $SCRIPT $IMRS_CBOR $IPSTATS_DIR $MONTH $ITHITOOLS +python3.6 $SCRIPT $IMRS_CBOR $IPSTATS_DIR $MONTH $ITHITOOLS > $RUN_LOG