Ajout script save_apache_status web
This commit is contained in:
parent
9905749aea
commit
55e35a8ea0
|
@ -1103,6 +1103,19 @@ find $DIR -type f -mtime +1 -delete
|
||||||
exit 0
|
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 :
|
Il sera ensuite appelé dans une tâche cron de root :
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
|
|
Loading…
Reference in a new issue