Changeset 219 for scripts/usr/local/lib/7dtd/monitor-log.sh
- Timestamp:
- Dec 19, 2014, 6:51:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/monitor-log.sh
r204 r219 10 10 11 11 INSTANCE=$1 12 LOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_output.log 12 LOG=$2 13 #LOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_output_log.txt 13 14 CHATLOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_chat.log 14 15 COMMANDLOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_commandExecution.log … … 85 86 echo >> $LOG 86 87 87 rm $(getInstancePath $INSTANCE)/logs/current_output .log88 rm $(getInstancePath $INSTANCE)/logs/current_output_log.txt 88 89 rm $(getInstancePath $INSTANCE)/logs/current_chat.log 89 90 rm $(getInstancePath $INSTANCE)/logs/current_commandExecution.log 90 ln -s $LOG $(getInstancePath $INSTANCE)/logs/current_output .log91 ln -s $LOG $(getInstancePath $INSTANCE)/logs/current_output_log.txt 91 92 ln -s $CHATLOG $(getInstancePath $INSTANCE)/logs/current_chat.log 92 93 ln -s $COMMANDLOG $(getInstancePath $INSTANCE)/logs/current_commandExecution.log … … 96 97 NOBUF="stdbuf -e0 -o0" 97 98 98 $NOBUF tail -n 5000 -F $(getInstancePath $INSTANCE)/logs/ output_log.txt|99 $NOBUF tail -n 5000 -F $(getInstancePath $INSTANCE)/logs/$LOG | 99 100 $NOBUF tr '\\' '/' | 100 101 $NOBUF tr -d '\r' | 101 102 $NOBUF grep -v "^(Filename: " | 102 $NOBUF sed -r 's/^[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+ [0-9]+[.,][0-9]+ (.*)$/\1/' |103 $NOBUF sed -r 's/^[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+ [0-9]+[.,][0-9]+ [A-Z]+ (.*)$/\1/' | 103 104 while read line ; do 104 105 if [ -n "$line" ]; then 105 echo "$(timestamp): $line" >> $LOG106 106 #Player connected, clientid=[0-9]*, entityid=[0-9]*, name=.*, steamid=[0-9]*, ip=[0-9.]*$ 107 107 if [ -n "$(echo "$line" | grep '^Player connected,')" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.