19
0
Fork 0

Ajout script save_apache_status web

This commit is contained in:
emorino 2020-09-28 11:55:30 +02:00
parent 9905749aea
commit 55e35a8ea0
1 changed files with 13 additions and 0 deletions

View File

@ -1103,6 +1103,19 @@ find $DIR -type f -mtime +1 -delete
exit 0
~~~
Si on veux le sauvegarder dans /var/www/ pour y acceder par le serveur web, on peux utilisé un script de ce type :
~~~
#!/bin/sh
DATE=$(date +%Y-%m-%d-%H-%M)
URL=$(grep -m1 "<Location.*server-status" /etc/apache2/sites-enabled/000-default.conf|awk '{ print $2 }' |cut -d'>' -f1)
mkdir -p /var/www/apache-status
curl -Ls http://127.0.0.1${URL} > "/var/www/apache-status/${DATE}.html" && chmod 644 "/var/www/apache-status/${DATE}.html"
find "/var/www/apache-status/" -type f -mtime +4 -delete
~~~
Il sera ensuite appelé dans une tâche cron de root :
~~~