473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

limit folder size

Hi,I would like to limit a folder space (in a shell script):
when the folder exceeds the maximum size, I have to remove the oldest files
How to do this and how to make it running all the time?

thanks for the help
Apr 19 '11 #1
1 3286
sicarie
4,677 Expert Mod 4TB
I would create a script that ran a 'du -hs /path/to/folder' to check the size. Then you could use sed or awk to get the list of the contents of that folder - including date (or pipe ls -alh or something into it), and remove the 'biggest'.

That script would then go into cron and be set for how often you'd like it to run.
May 1 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sunny Shah | last post by:
hello php programmers & friends, i want to limit the size of my folder. is there any code in php or other language to check the size n limit it or display warning msg. please guide me. ...
5
by: Sehboo | last post by:
Hi, Is there any easy way to limit the size of the string? I have Private msDescription As String I want to limit the msDescription to 50 instead of unlimitted.
4
by: Hughs Man | last post by:
I am using exchange 2003 now Recently I was notified the harddisk is out of space. Thus I remove part of the email of each folder and the public folder. But the folder size doesn't trim down. ...
0
by: Kevin F | last post by:
I'm trying to use the following code to get my remote server's folder size information. Unfortunately, i'm getting the error: Traceback (most recent call last): File...
1
by: Kevin F | last post by:
I'm trying to use the following code to get my remote server's folder size information. Unfortunately, i'm getting the error: Traceback (most recent call last): File...
3
by: TyBreaker | last post by:
I have a vbscript which returns the folder size of any folder instantly by referring to Folder.Size. I don't need any iteration or recursion through the subfolders, adding together individual file...
0
by: nemesis.saurabh | last post by:
hi, can we limit the size of placeholder dynamically i.e through codebehind. limiting through html caused an exception that this a run time property only. in web author it shows whatever i...
9
by: freduchi | last post by:
Hi, I need sugestions. I need to implement the next and I donīt know how to do it: I am developing a website in which users are signed up and share information(Messages, Photos...). When a...
0
by: Pauli | last post by:
Hi all, I am working on Linux (redhat) and I am executing a Perl script. By the help of this script I want to limit the size of the files that the script will create. How can I do it?? P.s:...
4
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all how can I get folder size with high performance ?? Do I need use recursive method for all files-subfolders within root folder ?? Anyway for do it ?? Perhaps using API Windows ?? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.