Outils pour utilisateurs

Outils du site


admin:services:date.chapril.org

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
admin:chatons:date.chapril.org [2019/12/07 18:41] dclermonteadmin:chatons:date.chapril.org [2020/02/05 15:36] – [Ajout d'une purge automatique] dclermonte
Ligne 418: Ligne 418:
 </code> </code>
  
-Définir une entrée crontab :+Créer un fichier datechaprilorg et le placer dans /etc/cron.d et une copie dans /srv/date.chapril.org/tools/rapport_activite:
 <code> <code>
-crontab -e -u datechaprilorg +45 23 * * * root /usr/bin/php /var/www/date.chapril.org/admin/cron_purge.php >> /srv/date.chapril.org/cron_purge.log 2>&
- +41 11 * * * root /usr/bin/php /var/www/date.chapril.org/admin/cron_purge.php >> /srv/date.chapril.org/cron_purge.log 2>&
-45 23 * * * /usr/bin/php /var/www/date.chapril.org/admin/cron_purge.php >> /srv/date.chapril.org/cron_purge.log 2>&1+1 0 1 * * root  /srv/date.chapril.org/tools/rapport_activite/rapport_activite.sh -p >> /srv/date.chapril.org/Exploitation/rapport_date.log 2>&1
 </code> </code>
  
 ====== Monitoring ====== ====== Monitoring ======
  
-Mettre dans le dossier /usr/lib/nagios/plugins un fichier check_datechaprilorg_update+Mettre dans le dossier /usr/lib/nagios/plugins un fichier check_datechaprilorg_update et une copie dans /srv/date.chapril.org/tools/monitoring :
  
 <code> <code>
 +#!/bin/bash
 function usage() { function usage() {
  echo "Usage : $0"  echo "Usage : $0"
Ligne 438: Ligne 439:
     usage     usage
 else else
-    lastVersion=$(curl -s https://privatebin.info/|grep Current|cut -d' ' -f3|cut -d'<' -f1+    lastVersion=$(curl -s https://framagit.org/api/v4/projects/16/releases jshon -a -e name|cut -d '"' -f2|grep -'[\^\(alpha\)]'|head -n 1
-    currentVersion=$(cd /var/www/paste.chapril.org && git branch | grep '*'|cut -c 11-100 ) +    currentVersion=$(cd /var/www/date.chapril.org && git branch | grep '*'|cut -c 11-100 ) 
-    #echo $lastVersion+
     #echo $currentVersion     #echo $currentVersion
 +    #echo $lastVersion
     if [ $currentVersion = $lastVersion ]; then     if [ $currentVersion = $lastVersion ]; then
- echo  "OK"+ echo "OK"
  result=0  result=0
     else     else
- echo  "WARNING : new version available, current is $currentVersion, last is $lastVersion."+ echo "WARNING : new version available, current is $currentVersion, last is $lastVersion."
  result=1  result=1
     fi         fi    
Ligne 453: Ligne 455:
  
 </code> </code>
 +
 +Le fichier est commité dans ''/srv/date.chapril.org/tools/monitoring''.
admin/services/date.chapril.org.txt · Dernière modification : 2023/02/25 11:30 de obitanz