Monitor folder size

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.

3

2 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

1

watch 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like