Created
January 23, 2014 07:58
-
-
Save unfo/8574668 to your computer and use it in GitHub Desktop.
Very naive/simplistic logger to see how incoming file transfers are moving => able to gauge transfer speeds of files and/or total halt of transfers after the fact.
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 | |
# crontab example: | |
# 30 20 * * * echo "" > /tmp/bar ; /data/network-debugging/ls-logger.sh | |
# 30 08 * * * echo 1 > /tmp/bar | |
INPUT_DIR=/data/foobar/input | |
DTM="$(date +%Y-%m-%d-%H-%M)" | |
LOGFILE="/data/network-debugging/ls.log-$DTM" | |
foo=`cat /tmp/bar` | |
while [ "$foo" == "" ]; do | |
ls --full-time $INPUT_DIR | xargs -n1 -I% sh -c 'echo -e "$(date --rfc-3339=ns) %"' >> $LOGFILE | |
sleep 1 | |
foo=`cat /tmp/bar` | |
done | |
gzip $LOGFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment