Projet

Général

Profil

Paste
Télécharger (324 octets) Statistiques
| Branche: | Révision:

root / bin / log.sh @ 6a93dd76

1
#!/bin/sh
2
. /home/assos/bin/scripts-config.sh
3

    
4
# Read stdin (so stdout from the command passed in argument)
5
log=$(cat)
6
command="$1"
7

    
8
current_day=$(date "+%Y-%m-%d")
9
current_time=$(date "+%H-%M-%S")
10
log_file="${d7_dir_log}/${current_day}.log"
11

    
12
echo -e "#### ${command} - ${current_time}\n${log}\n#### END\n" >> "${log_file}"