Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jaydestro/b30ee6f555816f08542c6a0c7aa0aa72 to your computer and use it in GitHub Desktop.
Save jaydestro/b30ee6f555816f08542c6a0c7aa0aa72 to your computer and use it in GitHub Desktop.
process-logs.sh
#!/bin/bash
timestamp=$(date +%s)
mkdir -p /goaccess/latest-$timestamp/
cp /var/log/nginx/access.log* /goaccess/latest-$timestamp/
cd /goaccess/latest-$timestamp/
zcat -f access.log* | goaccess -a -o report.html >/www/newblog/jaydestro.org/client/blog/_content/report.html
rm -rf /goaccess/latest-$timestamp/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment