From 7909a17fbff140b637a9af29a20763740d5af510 Mon Sep 17 00:00:00 2001 From: an Date: Sun, 1 Jul 2018 15:36:31 +0200 Subject: [PATCH] made logforward.sh parameter driven --- logforward.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/logforward.sh b/logforward.sh index 695bc43..5cda1eb 100644 --- a/logforward.sh +++ b/logforward.sh @@ -1,11 +1,6 @@ #!/bin/sh -varnishncsa -F '%{X-Forwarded-For}i %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"' | logforward -h backup01.scn.chefkoch.net:22 -p /srv/logfiles_seo/webxx- -u root -k /etc/varnish/id_rsa_lf -b 100000000 - -#!/bin/sh -#trap 'echo oh, I am slain; exit' INT -#while true; do -# DATE=`date +"%Y%m%d%H%M"` -# echo "starting new logfile `hostname`-$DATE" -# ./timelimit -t10800 -T5 varnishncsa -F '%{X-Forwarded-For}i %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"' > log/`hostname`-$DATE.log -# (gzip log/`hostname`-$DATE.log ; scp log/*.gz an@backup01.scn.chefkoch.net:/srv/logfiles_seo ; rm log/*.gz) & -#done +trap 'echo oh, I am slain; exit' INT +while true; do + #varnishncsa -F '%{X-Forwarded-For}i %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"' | logforward -h backup01.scn.chefkoch.net:22 -p /srv/logfiles_seo/webxx- -u root -k /etc/varnish/id_rsa_lf -b 100000000 + varnishncsa -F '%{X-Forwarded-For}i %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"' | logforward -h $1 -p $2 -u root -k $3 -b 100000000 +done