Created
September 10, 2023 19:49
-
-
Save allejo/da7a7f2c54137af351caabb17a36171a to your computer and use it in GitHub Desktop.
$ bzfs > logger.sh logs 5154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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