Commit e0f0ae5f authored by Mattia Rizzolo's avatar Mattia Rizzolo

stats: do not compute the stats if nothing happened in the last log, as goaccess 1.2 fails on that

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mapreri@ubuntu.com>
parent 4c78c9f1
......@@ -30,6 +30,11 @@ for dir in "${logdirs[@]}"; do
sitename=$(basename "$dir")
if [[ -d "${dir}" ]]; then
echo "Generating stats for ${sitename}..."
if [[ ! -s "$dir/access.log" ]]; then
echo "+ access.log for $sitename is empty, reusing the last analysis."
cp "/srv/stats.ubuntu-it.org/current/${sitename}.html" "${deploy}/${sitename}.html"
continue
fi
# blackhole stderr because that's where the progress counter goes,
# filling up the log/screen/terminal
zgrep -h "" "${dir}"/access* | goaccess - \
......
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