LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-04-2010, 09:35 PM   #16
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30

sorry to bump such an old topic but i'm having a problem with this deleting file that have very old dates

like lets say i download a file onto my server and it had a modification date of xx/xx/2009 and my script is set to "-mtime +7" it will of course delete it but it isn't REALLY that old... can something be done about this?

full script:

(will delete ALL files bigger then 1mb and older then 7 days in the folder '/home/folder')
Code:
find /home/folder -name "*" -type f -mtime +7 -size +1M -exec rm {} \;

Last edited by steve51184; 03-04-2010 at 09:36 PM.
 
Old 03-05-2010, 12:30 AM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Just use the touch cmd to update the file times at the end of the download process.
 
  


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
logging daily cron jobs in separate files csmwlee Linux - Newbie 5 10-10-2005 10:30 AM
cron job to delete files based on attributes alpha21 Linux - General 3 11-09-2004 12:06 PM
Cron - Delete Files nigeledge Linux - Software 1 10-14-2004 10:36 PM
howto delete files via ftp from cron job ? cccc Linux - Networking 2 01-31-2004 06:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:07 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
Open Source Consulting | Domain Registration