Ignore:
Timestamp:
Dec 19, 2014, 6:51:16 PM (10 years ago)
Author:
alloc
Message:

scripts 71

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/monitor-log.sh

    r204 r219  
    1010
    1111INSTANCE=$1
    12 LOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_output.log
     12LOG=$2
     13#LOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_output_log.txt
    1314CHATLOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_chat.log
    1415COMMANDLOG=$(getInstancePath $INSTANCE)/logs/$(date '+%Y-%m-%d_%H-%M-%S')_commandExecution.log
     
    8586echo >> $LOG
    8687
    87 rm $(getInstancePath $INSTANCE)/logs/current_output.log
     88rm $(getInstancePath $INSTANCE)/logs/current_output_log.txt
    8889rm $(getInstancePath $INSTANCE)/logs/current_chat.log
    8990rm $(getInstancePath $INSTANCE)/logs/current_commandExecution.log
    90 ln -s $LOG $(getInstancePath $INSTANCE)/logs/current_output.log
     91ln -s $LOG $(getInstancePath $INSTANCE)/logs/current_output_log.txt
    9192ln -s $CHATLOG $(getInstancePath $INSTANCE)/logs/current_chat.log
    9293ln -s $COMMANDLOG $(getInstancePath $INSTANCE)/logs/current_commandExecution.log
     
    9697NOBUF="stdbuf -e0 -o0"
    9798
    98 $NOBUF tail -n 5000 -F $(getInstancePath $INSTANCE)/logs/output_log.txt |
     99$NOBUF tail -n 5000 -F $(getInstancePath $INSTANCE)/logs/$LOG |
    99100$NOBUF tr '\\' '/' |
    100101$NOBUF tr -d '\r' |
    101102$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/' |
    103104while read line ; do
    104105        if [ -n "$line" ]; then
    105                 echo "$(timestamp): $line" >> $LOG
    106106                #Player connected, clientid=[0-9]*, entityid=[0-9]*, name=.*, steamid=[0-9]*, ip=[0-9.]*$
    107107                if [ -n "$(echo "$line" | grep '^Player connected,')" ]; then
Note: See TracChangeset for help on using the changeset viewer.