Apache için basit bir log viewer

#!/bin/bash
if [ ! -f /tmp/logcopy ]
then
echo "first run, copying log file"
cp /var/log/apache2/access.log /tmp/logcopy
fi
oldfilehash=`md5sum /tmp/logcopy | cut -d " " -f1`
newfilehash=`md5sum /var/log/apache2/access.log | cut -d " " -f1`
if [ "$oldfilehash" != "$newfilehash" ]; then
diff /var/log/apache2/access.log /tmp/logcopy > /tmp/logdiff
if [ ! $? -eq 0 ]; then
cat /tmp/logdiff | zenity --title "Apache Log Viewer" --text-info --width 1024 --height 800
fi
cp -u /var/log/apache2/access.log /tmp/logcopy
fi
exit

/usr/local/bin altına kaydedip kullanabilirsiniz.

Bookmark and Share
Tags: , , , , , ,

Related posts

Yazılım

Comments (0)

Permalink

apache access.log için python regex

r”"”(?P<karsi_taraf>[^ ]*) – (?P<kullanici>[^ ]*) \[(?P<tarih>[^\]]*)] “(?P<url>[^"]*)” (?P<cevap>[0-9]*) (?P<boyut>[0-9]*) “(?P<ref>[^"]*)” “(?P<browser>[^"]*)”"”

Bookmark and Share
Tags: , , ,

Related posts

Yazılım

Comments (0)

Permalink

Switch to our mobile site