LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 11:01 AM   #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:	347
Size:	7.0 KB
ID:	1433  
 
Old 09-08-2009, 11:23 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
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 11:32 AM. Reason: fix error with rm
 
Old 09-08-2009, 12:01 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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



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 03:42 AM
files edit in the last 2 hours hosney00ux Linux - General 7 08-25-2009 07:24 AM
Script help - delete files older than 45 days but exclude the system files jojothedogboy Linux - Software 3 06-13-2008 03:43 PM
Deleting Files Older Than 2 Hours using Find? LinuxGeek Linux - Software 1 06-29-2005 06:10 AM
WARNING: DNS record is older than 3 hours drake_101 Linux - Newbie 0 01-05-2005 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:14 AM.

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
Open Source Consulting | Domain Registration