From 663b7c45177abb1827eae84f46ac1d008b87f295 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 16 Feb 2023 23:06:03 +0100 Subject: [PATCH] ajout robots --- roles/deploy-web/files/getinfo_day.sh | 4 ++++ roles/deploy-web/files/getinfo_month.sh | 4 ++++ roles/deploy-web/files/getinfo_week.sh | 3 +++ 3 files changed, 11 insertions(+) diff --git a/roles/deploy-web/files/getinfo_day.sh b/roles/deploy-web/files/getinfo_day.sh index 6866cb8..e259ebf 100755 --- a/roles/deploy-web/files/getinfo_day.sh +++ b/roles/deploy-web/files/getinfo_day.sh @@ -26,6 +26,7 @@ do cat $log_access | grep "|" | awk -F "|" '{print $1}' | sort | uniq > $directory_host/list_$DATE cat $log_access | awk -F "|" '{ if($2 == "404") print $1}' > $directory_host/404_$DATE cat $log_access | awk -F "|" '{ if($2 == "400") print $1}' > $directory_host/400_$DATE + grep robots.txt $log_access | awk -F '|' '{print $3}' > $directory_host/robots_$DATE while read line; do if grep $line $DIRECTORY/*/*/output_*.txt > /dev/null 2>&1; then grep -h -B1 -A8 $line $DIRECTORY/*/*/output_*.txt |head -10 >> $directory_host/output_$DATE.txt @@ -50,6 +51,9 @@ do cat $directory_host/${j}_$DATE |sort |uniq -c >> ${MAIL} echo "--------" >> ${MAIL} done + echo "nombre de robots " >> ${MAIL} + cat $directory_host/robots_$DATE |sort |uniq -c >> ${MAIL} + echo "---------" >> ${MAIL} cat ${MAIL} |mail -s "Rapport reverse proxy $DATE" -A $directory_host/output_$DATE.txt valczebackup@gmail.com #rm $directory_host/* done diff --git a/roles/deploy-web/files/getinfo_month.sh b/roles/deploy-web/files/getinfo_month.sh index b563ae4..ae5e780 100755 --- a/roles/deploy-web/files/getinfo_month.sh +++ b/roles/deploy-web/files/getinfo_month.sh @@ -23,6 +23,10 @@ do cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL} echo "----------------" >> ${MAIL} done + echo "nombre de robots :" >> ${MAIL} + cat $directory_host/robots_* |sort |uniq -c >> ${MAIL} + echo "----------------" >> ${MAIL} + cat ${MAIL} |mail -s "Rapport mensuel reverse proxy ${i} $DATE" valczebackup@gmail.com rm -rf $directory_host done diff --git a/roles/deploy-web/files/getinfo_week.sh b/roles/deploy-web/files/getinfo_week.sh index f54e4b0..e791c2a 100755 --- a/roles/deploy-web/files/getinfo_week.sh +++ b/roles/deploy-web/files/getinfo_week.sh @@ -36,6 +36,9 @@ do cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL} echo "----------------" >> ${MAIL} done + echo "nombre de robots :" >> ${MAIL} + cat $directory_host/robots_* |sort |uniq -c >> ${MAIL} + echo "----------------" >> ${MAIL} cat ${MAIL} |mail -s "Rapport hebdomadaire reverse proxy ${i} $DATE" valczebackup@gmail.com #rm $directory_host/* done