The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Disk Usage in GB and Unix command to find the biggest file/folder manas6 UNIX for Dummies Questions & Answers 8 07-30-2008 07:54 AM
Problem using find and xargs quixote Shell Programming and Scripting 5 05-02-2008 10:24 PM
Usage find command raman1605 SUN Solaris 2 08-05-2007 01:45 AM
find command usage zp523444 UNIX for Advanced & Expert Users 1 11-29-2005 12:33 AM
find | xargs cat asal_email Shell Programming and Scripting 4 03-17-2005 12:16 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-19-2007
darkrainbow darkrainbow is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 10
command usage on find with xargs and tar

my task : tar up large bunch of files(about 10,000 files) in the current directories that created more than 30 days ago
but it come with following error

find ./ -ctime +30 | xargs tar rvf test1.tar
tar: test1.tar: A file or directory in the path name does not exist.
  #2 (permalink)  
Old 12-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
If the tar file does not exist you cannot update it!

So I would create the tar file first adding a single readme file describing what it contains, then do what you were going to do.

However, for sanities sake, use find to create the list of files, then you will have a record of what you were putting in the tar file, so if you need to move or delete them you can do so from that list.

Also, you don't want the tar file itself to be included.
  #3 (permalink)  
Old 12-23-2007
darkrainbow darkrainbow is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 10
Quote:
Originally Posted by porter View Post
If the tar file does not exist you cannot update it!

So I would create the tar file first adding a single readme file describing what it contains, then do what you were going to do.

However, for sanities sake, use find to create the list of files, then you will have a record of what you were putting in the tar file, so if you need to move or delete them you can do so from that list.

Also, you don't want the tar file itself to be included.

thank for your reply, it work with your recommandation but it is kind of weird way to make it work in my mind.
  #4 (permalink)  
Old 12-25-2007
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
When you use find already, what do you need xargs for? Just a suggestion: use the -exec clause in find:

find . -ctime +30 -exec tar -rvf test1.tar {} \;

bakunin
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0