LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-08-2009, 12:01 PM   #1
a4kata
Member
 
Registered: Aug 2009
Posts: 30

Rep: Reputation: 0
Deleting files older than 1 hours


Hello, on my site now I'm using cache and need me cron script that will delete files older than 1 hour I have feature in my kloxo control panel just need me the command . Thanks in advance
Attached Thumbnails
Click image for larger version

Name:	sshot-4.png
Views:	81
Size:	7.0 KB
ID:	1433  
 
Old 09-08-2009, 12:23 PM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,038

Rep: Reputation: 97
Have you used the LQ search facility?

I'm sure I've seen similar threads (lots of them in fact)

use find

Code:
find /path/I/want/to/search -type f -mmin +60 -exec rm {} \;
I would first suggest running the search part alone (to ensure that you are getting the correct list of files to be deleted!

Code:
find /path/I/want/to/search -type f -mmin +60

Last edited by Disillusionist; 09-08-2009 at 12:32 PM. Reason: fix error with rm
 
Old 09-08-2009, 01:01 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
This will work as well:
find /path/I/want/to/search -type f -mmin +60 -delete

Be sure to use "-type f" because it will delete other filetypes.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Question - Delete files in a dir older than 48 hours? t3___ Linux - Newbie 5 10-11-2011 04:42 AM
files edit in the last 2 hours hosney00ux Linux - General 7 08-25-2009 08:24 AM
Script help - delete files older than 45 days but exclude the system files jojothedogboy Linux - Software 3 06-13-2008 04:43 PM
Deleting Files Older Than 2 Hours using Find? LinuxGeek Linux - Software 1 06-29-2005 07:10 AM
WARNING: DNS record is older than 3 hours drake_101 Linux - Newbie 0 01-05-2005 10:57 PM


All times are GMT -5. The time now is 10:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration