'Pause a process before disk is full

Certain processes (like git gc --aggressive) take a long time to run, take up lots of disk space, and die if I run out of disk space. I'd like to pause them if the disk will run out of space soon, so I have time to free up some memory. How can I do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source