Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File server

Status
Not open for further replies.

Momozone

IS-IT--Management
Joined
Dec 2, 2004
Messages
103
Location
IE
I am using Asterisk and have another server doing NFS for all the recordings on the Asterisk box. All these recordings are really starting to pile up amounting to thousands. I want to run a daily cron job to remove file that are less than a specific file size.

Can someone please help me?

How do I remove files in this directory that are less than 15k an on ly these file. Not removing anything over 15k.

Thanks in advance.

MoMoZoNe
 
You can try use gawk


Code:
ls -l | gawk '{if ($5 < 15000) print $9}' | rm -f

or something similar. I am not too sure if you can pipe to rm command.


QatQat

Life is what happens when you are making other plans.
 
How about:
[tt]
rm `find . -size -15000c`
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top