mirror of
https://github.com/chubin/wttr.in.git
synced 2024-10-05 01:42:07 +02:00
Add share/scripts/log-space.sh
This commit is contained in:
parent
dd87ab5076
commit
7a7a8ab390
14
share/scripts/log-space.sh
Normal file
14
share/scripts/log-space.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
LOG_DIR="/wttr.in/log"
|
||||
LOG_FILE="$LOG_DIR/diskspace.log"
|
||||
|
||||
DISK=/wttr.in
|
||||
|
||||
log() {
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
echo "$(date +"[%Y-%m-%d %H:%M:%S]") $*" | tee -a "$LOG_FILE"
|
||||
}
|
||||
|
||||
log $(df -k "$DISK" | tail -1 | awk '{print $4}')
|
Loading…
Reference in New Issue
Block a user