diff options
author | V.Krishn <vkrishn4@gmail.com> | 2021-11-27 03:22:35 +0530 |
---|---|---|
committer | V.Krishn <vkrishn4@gmail.com> | 2021-11-27 03:22:35 +0530 |
commit | b3941fdf0147083f58ef065d7cfddb53dbd2304a (patch) | |
tree | b2933823d17f79b9c653208aa2707ea4db81634d | |
parent | 1bc175fe1d3b391a5bf3b25499364c38293e035f (diff) | |
download | nbreader-b3941fdf0147083f58ef065d7cfddb53dbd2304a.tar.bz2 |
change log file name format and folder
- move var/newsbeuter/log var/log/newsbeuter
- change default file format to yyyy-dd-mm.log
-rw-r--r-- | scripts/config.sh | 1 | ||||
-rw-r--r-- | scripts/date.inc | 2 | ||||
-rw-r--r-- | scripts/env.sh | 3 | ||||
-rw-r--r-- | scripts/feedicon.sh | 6 | ||||
-rw-r--r-- | scripts/fetch.sh | 6 |
5 files changed, 11 insertions, 7 deletions
diff --git a/scripts/config.sh b/scripts/config.sh index 401ffd3..10967bf 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -39,6 +39,7 @@ if [ ! -d "$DATADIR" ]; then mkdir -p $DATADIR; fi; if [ ! -d "$URLDIR" ]; then mkdir -p $URLDIR; fi; if [ ! -d "$URLLOCALDIR" ]; then mkdir -p $URLLOCALDIR; fi; if [ ! -d "$FEEDSDIR" ]; then mkdir -p $FEEDSDIR; touch "$FEEDSDIR/.feeds"; fi; +if [ ! -d "$LOGDIR" ]; then mkdir -p $LOGDIR; fi; csvfile="$RUNDIR/urls.csv"; urldb="$CONFIGDIR/urls.db" diff --git a/scripts/date.inc b/scripts/date.inc index 5cb5c3f..3d1058c 100644 --- a/scripts/date.inc +++ b/scripts/date.inc @@ -5,9 +5,11 @@ TIMESTAMP=$(date +%y%m%d.%H%M%S) NOW=$(date +%Y%m%d-%H%M%S-%s) DATESTAMP=$(date +%y%m%d) +DATESTAMP2=$(date +%Y%m%d) MONTHSTAMP=$(date +%y%m) TIME=$(date +%H%M%S) YEAR=$(date +%Y) MONTH=$(date +%m) +DAY=$(date +%d) MONTHLY=$(date +%Y-%m) diff --git a/scripts/env.sh b/scripts/env.sh index 89f0d54..63b3680 100644 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2015-2020 V.Krishn +# Copyright (c) 2015-2021 V.Krishn # # This program is free software; you can redistribute it and/or # modify it under the terms of the Simplified BSD License (also @@ -44,6 +44,7 @@ URLDIR="$CONFIGDIR/url" URLLOCALDIR="$CONFIGDIR/url.local" #URLDIR="$CONFIGDIR/test" VARDIR="$APPDIR/var/newsbeuter" +LOGDIR="$APPDIR/var/log/newsbeuter" RUNDIR="$APPDIR/var/run/newsbeuter" FEEDSDIR="$VARDIR/feeds/feeds" DBDIR="$VARDIR/db" diff --git a/scripts/feedicon.sh b/scripts/feedicon.sh index a7abe46..085acf6 100644 --- a/scripts/feedicon.sh +++ b/scripts/feedicon.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2015-2020 V.Krishn +# Copyright (c) 2015-2021 V.Krishn # # This program is free software; you can redistribute it and/or # modify it under the terms of the Simplified BSD License (also @@ -90,7 +90,7 @@ get_site_base() { clean_temp_icon local BURL=$1 echo -e ${cYELLOW}'msg: fetching base site -> '${cNORMAL}${BURL} '...'; - local logfile="$VARDIR/log/$DATESTAMP.log" + local logfile="$LOGDIR/$MONTHLY-$DAY.log" if [ $USECURL = '1' ]; then curl $CURLOPTS_1 --user-agent "$_USERAGENT_0" "$BURL" -o "$localHtml" -v --stderr - >> $logfile @@ -141,7 +141,7 @@ check_icon_size() { fetch_feedicon() { clean_temp_icon; local _fi=$1 - local logfile="$VARDIR/log/$DATESTAMP.log" + local logfile="$LOGDIR/$MONTHLY-$DAY.log" echo -e ${cYELLOW}"msg: fetching icon ->${cNORMAL} $_fi ..."; if check_icon_size "$_fi"; then if [ $USECURL = '1' ]; then diff --git a/scripts/fetch.sh b/scripts/fetch.sh index 012e9cb..c1a1b4a 100644 --- a/scripts/fetch.sh +++ b/scripts/fetch.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2015-2020 V.Krishn +# Copyright (c) 2015-2021 V.Krishn # # This program is free software; you can redistribute it and/or # modify it under the terms of the Simplified BSD License (also @@ -109,8 +109,8 @@ fetch_url() { mkdir -p "$a/$b" if [ -f "$localXml" ]; then rm -f "$localXml"; fi - mkdir -p $VARDIR/log - local logfile="$VARDIR/log/$DATESTAMP.log" + mkdir -p $LOGDIR + local logfile="$LOGDIR/$MONTHLY-$DAY.log" if [ $USECURL = '1' ]; then curl $CURLOPTS_1 --user-agent "$_USERAGENT_0" "$URL" -o "$localXml" -v --stderr - >> "$logfile" |