LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 01-27-2006, 03:31 PM   #1
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
setting maximum folder size


Is there a way to set the maximum size of a file folder in linux? Could I say that /home/user/mydocs can only hold 1GB of data? Let me know. Thanks!
 
Old 01-27-2006, 03:51 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
The only way I know how to do it is use quotas. Google for info on disk quotas at http://www.google.com/linux . I posted this a few days ago but never tried it myself. http://www.linuxquestions.org/questi...87#post2063987

With quotas to work it needs to be a defined partition so if you already have /home as a partition of its own then setting quotas will be quick and easy. If /home is on the / partition then it will not work. My idea in the above post should work okay.

See if that works out.
Brian1
 
Old 01-27-2006, 04:00 PM   #3
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Original Poster
Rep: Reputation: 30
thanks for the reply. I found another post about this on a osx server discussion board. One user recommended writing a simple shell script to check the folder's size and e-mail me a notification if it exceeds the limit. That may be the easiest way to do it.
 
Old 01-27-2006, 05:59 PM   #4
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
From your post I did a quick search and found this one that list a script that I think is what you are after. http://www.linuxforums.org/forum/arc...p/t-46726.html
I did not look over the script but my thinking is a script that runs from cron every hour maybe that looks in /home and sorts it size. Then it can send you an email of the output or maybe the tail of the output. Or go farther and check the output for vaules higher than you want and just email that to you when it is over the limit. Less email this way. The script in the link might be what I am talking about.

Somethings are the simpliest.
Brian1
 
Old 01-27-2006, 06:46 PM   #5
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
If you not really needed to know right now when it happens from a script send the tail end of the du command to your local mail. Something like this.

du -k -h --max-depth=1 /home | sort -n | tail -20 | mail -s " /home heavy users " username_local_mail
du -k -h --max-depth=1 /home | sort -rn | tail -20 | mail -s " /home heavy users " username_mail_account

Can be added to a cron to run whenever you want.

Just something I thought about learning.
Brian1
 
Old 03-26-2010, 12:36 PM   #6
kwanu
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Rep: Reputation: 0
Hi,

can you tell me how can you solve this problem?
I think I have same issue, but I donot know how I can I solve it.

Thanks,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting max folder size mull300 Linux - Security 1 01-24-2006 06:02 PM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
Is it possible to set a maximum folder size? KDE bglnelissen General 1 03-20-2005 08:39 AM
Setting maximum size of windows desheikh Linux - General 5 03-17-2005 09:43 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 03:26 AM


All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration