|
Home > Archive > Unix administration > January 2004 > limit directory size
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
limit directory size
|
|
| =?ISO-8859-1?Q?J=F6rg_Kleimann?= 2004-01-23, 4:54 pm |
| Hi, perhaps someone knows how to limit the size of a certain directory
within a partition.
On the certain partition disk qoutation is active for users and groups.
the ownership of the data in the directory should not matter, it has
just to be below a certain size.
Thanks for your help,
Joerg.
| |
| Barry Margolin 2004-01-23, 4:54 pm |
| In article <3FB8D2B6.9070004@unige.ch>,
Jörg Kleimann <Jorg.Kleimann@unige.ch> wrote:quote:
>Hi, perhaps someone knows how to limit the size of a certain directory
>within a partition.
>
>On the certain partition disk qoutation is active for users and groups.
>the ownership of the data in the directory should not matter, it has
>just to be below a certain size.
I don't think Unix has a built-in way to do this. What people usually do
is write a script that runs "du -s <directory>" to get the total size, and
alert the administrator if it exceeds the limit.
--
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
| |
| Bill Marcum 2004-01-23, 4:54 pm |
| On Mon, 17 Nov 2003 14:52:54 +0100, Jörg Kleimann
<Jorg.Kleimann@unige.ch> wrote:quote:
> Hi, perhaps someone knows how to limit the size of a certain directory
> within a partition.
>
> On the certain partition disk qoutation is active for users and groups.
> the ownership of the data in the directory should not matter, it has
> just to be below a certain size.
>
As far as I know, there is no built-in way to limit the size of a
directory. Perhaps you could write a cron script that runs "du" and
deletes the newest files, or just remove write permission when the
directory reaches a certain size. Another option on Linux systems, and
perhaps others, is to create a file of a certain size, make a filesystem
in that file and mount it with "-o loop".
--
You can go anywhere you want if you look serious and carry a clipboard.
| |
| Doug Freyburger 2004-01-23, 4:54 pm |
| Jörg Kleimann wrote:quote:
>
> Hi, perhaps someone knows how to limit the size of a certain directory
> within a partition.
There is no way to do that directly, so you will have to approach it
indirectly.
Make the directory owned by its own user. Turn on disk quotas. Give
that special user a *very* small quota. That way the directory can
only grow to a certain size. Set the permissions to 777 or set them
to 775 and make it owned by the group of users you want to be able to
create files in it.
This strategy will only limit the number of files flat. If they
create subdirectories, you'll need to give them disk quotas, or make
the directory tree its own small filesystem.
|
|
|
|
|