Commit dea4b09e authored by Bruno Ribas's avatar Bruno Ribas

HISTORY of generated files can be saved

There are TWO new variables that will provide history generation:
$HISTORY default is "true"
 +Here we will define if generator must create a history of indexes from
  generated websites (for each file in $TYPEDIR)

$HISTORYFILEFORMAT default is "%Y%m%d%H%M"
 +History file will be index.html.$(date +"$HISTORYFILEFORMAT")

wwwsdi.conf was updated to provide an example to these brand new variables
Signed-off-by: default avatarBruno Ribas <ribas@c3sl.ufpr.br>
parent 220b0112
......@@ -33,6 +33,8 @@ fi
: ${DATADIR:=$PREFIX/coleta}
: ${TABLEATTRIBUTES:="border=\"1\""}
: ${GENERATESUMMARY:=false}
: ${HISTORY:=true}
: ${HISTORYFILEFORMAT:="%Y%m%d%H%M"}
#Global variable, to avoid multiple generation of names
COLUMNNAMES=
......@@ -99,6 +101,10 @@ function generate()
cat $PREFIX/html/footer.html
chmod a+r $TMP
mv "$TMP" "$WWWDIR/$(basename $1)/index.html"
if test "$HISTORY" = "true"; then
FileEND=$(date +"$HISTORYFILEFORMAT")
cp "$WWWDIR/$(basename $1)/index.html"{,.$FileEND}
fi
printf "$(basename $1): $START .. $(date +%X)\n" >&2
}
......
......@@ -4,3 +4,9 @@ TYPEDIR=NRES
TYPENAME=NRE
WWWDIR=www
DATADIR=../sdi/coleta
#Here we will define if generator must create a history of indexes from
#generated websites (for each file in $TYPEDIR)
HISTORY=true
#History file will be index.html.$(date +"$HISTORYFILEFORMAT")
HISTORYFILEFORMAT="%Y%m%d%H%M"
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