LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 11-23-2010, 11:55 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
Find and delete option remove wrong files


Hi all,

I have a log pruning script to delete log files older than 15 days in a particular directory . But the directory has files older than 7 days and not 15 days . Am wondering whether other scripts are impacting , but verified that they are not ,.

Is there a way to locate, why that happens ? removing files older than 7 days instead of 15 days ?

Code:
find /mydirectory  -mtime +15 -print -exec rm {} \;
 
Old 11-24-2010, 04:56 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Question

Quote:
Originally Posted by ZAMO View Post
the directory has files older than 7 days and not 15 days
Hi,

If you are removing files in that directory using rm command then how will they will be in same directory and show as 7 days old?
Those files must have been something else not 15 days old.
 
  


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
find and delete old files RAFAL Linux - General 4 03-30-2010 03:59 AM
Using find and rm command to delete files over x days old 200mg Linux - Newbie 16 09-03-2008 06:41 PM
Can't delete or remove files..... budword Linux - Desktop 5 02-16-2008 10:26 AM
delete files uncompressed into wrong directory safely petersk Linux - General 3 03-04-2007 01:38 PM
Mandrake 10.0 find files option. daan0106 Linux - Newbie 8 06-24-2004 01:25 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 06:11 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