Commit 29981df3 authored by Mattia Rizzolo's avatar Mattia Rizzolo

more rubost dir looping

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mapreri@ubuntu.com>
parent 40e552b4
......@@ -24,15 +24,18 @@ echo "${today}" > "${deploy}/.day"
echo "Options Indexes FollowSymLinks MultiViews" > "${deploy}/.htaccess"
echo "IndexOptions FancyIndexing" >> "${deploy}/.htaccess"
for dir in $(ls "${LOGS_DIR}"); do
if [[ -d "${LOGS_DIR}/${dir}" ]]; then
echo "Generating stats for ${dir}..."
mapfile -t logdirs < <(find "$LOGS_DIR" -mindepth 1 -maxdepth 1 -type d)
for dir in "${logdirs[@]}"; do
sitename=$(basename "$dir")
if [[ -d "${dir}" ]]; then
echo "Generating stats for ${sitename}..."
# blackhole stderr because that's where the progress counter goes,
# filling up the log/screen/terminal
zgrep -h "" "${LOGS_DIR}/${dir}"/access* | goaccess - \
zgrep -h "" "${dir}"/access* | goaccess - \
--log-format=COMBINED --http-protocol=no --ignore-panel=HOSTS \
--all-static-files --ignore-crawlers --real-os \
> "${deploy}/${dir}.html" 2> /dev/null
> "${deploy}/${sitename}.html" 2> /dev/null
fi
done
......
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