|
|
#1 (permalink) |
|
The Grim Reaper!
Join Date: May 2002
Location: Bulgaria
Posts: 2,387
|
Folder size quota in FreeBSD?
I have N (certain count) folders in a FreeBSD server. And N users logging into their own folders (no local accounts web interface only - PHP script). Any idea how to give a folder size quotas for each of the folders? FreeBSD 5.1. Should this be done via FreeBSD or with the web interface - the script. I have root account to the server.
|
|
|
|
|
|
#2 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
uhm. I don't get it.
Is this a filesystem quota problem? (are the users local unix users?) Or is this an application quota problem (virtual users, with virtual quotas) I assume it's the latter, then you can do anything that your creativity feeds you to limit users in their usage.
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#3 (permalink) |
|
The Grim Reaper!
Join Date: May 2002
Location: Bulgaria
Posts: 2,387
|
Yup it's the latter. The guy that made the software for our company couldn't do it via the script (site) and I have to figure out a way to do it with the OS. But since I don't have a real user access, with a web site and file manager (php script) to it, I was confused in searching a way to limit the quota.
|
|
|
|
|
|
#4 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
you can't do it with the OS. just do it with PHP.
It's a bit ugly and expensive, but you can call du -s <dir_root> and parse the output (in bytes) such that you do not allow more uploading, etc. when the value exceeds a soft limit. You have to see whether it is too slow or not, either use a database to keep track of the files and their sizes (SELECT sum(size) FROM files WHERE owner=$userid; you get the point)
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|