Is there a way to monitor and log folder size in Bash/Ubuntu? I'm running some computations and I need to know how much disk space they need. They may create some temporary folders for a few minutes/hours.
In fact, I need only a peak size of this folder.
32 Answers
you might try something like:
watch "du -skh /your-directory"
If size/number of file increases set interval with "-n" to much greater than 2 sec
Best,
Bodo
1watch is not created to produce log-files.
What you search is something like:
#!/bin/bash
while :
do du -skh /your-directory echo "Press [CTRL+C] to stop.." sleep 1
done