Projet

Général

Profil

Révision 5a1949a4

Ajouté par Julien Enselme il y a plus de 9 ans

Add scripts to log and report the log and the configuration file for unlog.

Voir les différences:

.unlog
1
[/home/assos/log/*]
2
start pattern = /home/assos/drupal7/sites/(assos.centrale-marseille.fr.\w+|default)
3
error pattern = (error|warning)
4
mail to = assos
bin/log-report.sh
1
#!/bin/sh
2
. /home/assos/bin/scripts-config.sh
3

  
4
current_day=$(date "+%Y-%m-%d")
5
log_file="${d7_dir_log}/${current_day}.log"
6

  
7
cat "${log_file}" | mail -s "Log: ${current_day}" assos
8
python3 /home/assos/tmp/unlog/unlog/main.py "${log_file}" --config /home/assos/.unlog  --mail-subject "Unlog: ${current_day}"
bin/log.sh
1
#!/bin/sh
2
. /home/assos/bin/scripts-config.sh
3

  
4
log=$(cat)
5

  
6
current_day=$(date "+%Y-%m-%d")
7
log_file="${d7_dir_log}/${current_day}.log"
8

  
9
echo "$log" > "${log_file}"

Formats disponibles : Unified diff