Create load logging script

This commit is contained in:
2020-07-23 18:02:56 +00:00
parent f6ed84608b
commit 1b6ec8682f
5 changed files with 28 additions and 1 deletions

16
load.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
export TZ="Europe/Stockholm"
LOGPATH="/home/ubuntu/minecraft/logs"
LOGFILE="$LOGPATH/$(date "+%F").log"
timestamp() {
date "+%R"
}
load() {
cat /proc/loadavg | awk '{print $1}'
}
echo "$(timestamp) $(load)" >> $LOGFILE