mirror of
https://github.com/AlexMacocian/ServerManagementUtils.git
synced 2026-07-15 15:19:58 +00:00
19 lines
405 B
Bash
19 lines
405 B
Bash
#!/bin/bash
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
. "${SCRIPT_DIR}/logging.sh"
|
|
|
|
LOGFILE=/var/log/disk_usage.log
|
|
touch "$LOGFILE"
|
|
chmod 644 "$LOGFILE"
|
|
|
|
for i in {1..6}; do
|
|
timestamp=$(GetTimestamp)
|
|
df --output=target,used,size -B1 \
|
|
| tail -n +2 \
|
|
| while read -r mount used total; do
|
|
echo "$timestamp $mount $used $total" >> "$LOGFILE"
|
|
done
|
|
|
|
sleep 10
|
|
done |