Commit a12d1130 authored by Mattia Rizzolo's avatar Mattia Rizzolo

stats: handle websites with no logs and no history

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mapreri@ubuntu.com>
parent 68477183
......@@ -32,7 +32,12 @@ for dir in "${logdirs[@]}"; do
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"
oldfile="/srv/stats.ubuntu-it.org/current/${sitename}.html"
if [ -f "$oldfile" ]; then
cp "$oldfile" "${deploy}/${sitename}.html"
else
echo "+ previous file for $sitename not available, probably a very new website."
fi
continue
fi
# blackhole stderr because that's where the progress counter goes,
......
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