LinuxQuestions.org
Visit Jeremy's Blog.
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 10-05-2010, 04:59 PM   #1
zivota
Member
 
Registered: May 2005
Distribution: CENTOS
Posts: 91

Rep: Reputation: 15
Find command issue


I am using find to search for .tgz files modified more than 7 days ago and delete them.

find /directory/ -iname backup*.tgz -daystart -mtime +7 -exec rm -rf {} \

My problem is that find will go through the content of tarball as well and list all content. I want to only search main tarball and delete it if older than 7 days.
 
Old 10-05-2010, 05:35 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Ummm ... if it does then it's because you told it to, and it's NOT
what the invocation above will do.



Cheers,
Tink
 
Old 10-05-2010, 05:40 PM   #3
zivota
Member
 
Registered: May 2005
Distribution: CENTOS
Posts: 91

Original Poster
Rep: Reputation: 15
Directory I am searching is mounted NFS share. Can that cause the issue?
 
Old 10-05-2010, 06:25 PM   #4
zivota
Member
 
Registered: May 2005
Distribution: CENTOS
Posts: 91

Original Poster
Rep: Reputation: 15
Problem solved. There was an issue with NFS server.
 
Old 10-05-2010, 06:36 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Please mark as SOLVED then.
 
  


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
[SOLVED] Find a file in directories without using find command sikanders Linux - Newbie 14 08-06-2010 08:47 PM
an important issue in find command any help pleas :) bhb Linux - Newbie 3 05-18-2010 06:36 PM
Find/grep/wc command to find matching files, print filename and word count dbasch Linux - Newbie 10 09-14-2009 05:55 PM
Postfix issue ; Must issue a STARTTLS command first after forcing TLS sarajevo Linux - Server 3 05-14-2009 08:28 AM
Single find command to find multiple files? thok Linux - Newbie 7 01-31-2009 04:45 PM

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

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