Skip to content

Instantly share code, notes, and snippets.

@allejo
Created September 10, 2023 19:49
Show Gist options
  • Save allejo/da7a7f2c54137af351caabb17a36171a to your computer and use it in GitHub Desktop.
Save allejo/da7a7f2c54137af351caabb17a36171a to your computer and use it in GitHub Desktop.
$ bzfs > logger.sh logs 5154
#!/bin/bash
log_location=$1
while read data
do
dt=`date +%Y-%m-%d`
port=$2
if [ ! -d "$log_location/$port" ]
then
mkdir -p "$log_location/$port"
fi
echo "$data" >> $log_location/$port/$port-$dt.log
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment