Packages are unpacked and compiled on a test system in /tmp/test
.
I need to get the maximum size the directory had at any moment during all these steps.
At the moment I help my self by recording the size with
du -sch /tmp/test >> /tmp/size.txt
in a loop. But this is a very dirty workaround and is not precise. It could be, that the computer is very busy in /tmp/test
and the du
misses the peak size. Is there a elegant solution?
The available file systems are ext, or btrfs if that helps.
One reader asked for usage examples:
When preparing packages for Gentoo Linux, I need to know how much space is needed during compilation. For some packages like Firefox, Boost or LibreOffice it is very important that the package verifies that enough free space is available.
I wrote scripts which create many temporary files. It would be interesting to monitor the folder size.
Update: In the meantime I found sysdig
which looks promising for this task, but I did not get a folder size yet.
du
ordf
. – Jonas Stein Jan 07 '18 at 20:38