How can I enforce directory space limits in a OpenVPZ system?
        Posted  
        
            by 
                George
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by George
        
        
        
        Published on 2011-06-27T22:46:59Z
        Indexed on 
            2011/06/28
            0:23 UTC
        
        
        Read the original article
        Hit count: 320
        
The title says it all. I have some programs on a server (centos4-openvz) that use a directory as temp directory - but pay no attention to the size it grows.
I want to enforcee a limit, like this folder cannot exceed 300mb.
I would use quota but OpenVZ does not support loop devices to mount a file as such.
Any other solutions? (apart from scripting a periodic delete of files in the directory).
Editing the application's code to implement such a functionality is not entirely out of the question - if it can be done easily and no other ways exist.. Its written in cpp - but I don't know how to implement it.
© Server Fault or respective owner