The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Listing directories and sub directories jinxor UNIX for Advanced & Expert Users 3 03-11-2008 07:27 AM
moving directories to new directories on multiple servers mackdaddy07 Shell Programming and Scripting 0 04-06-2007 08:30 AM
[awk]: Row begins by random number and field 10 is greater than 10.00% Lomic Shell Programming and Scripting 3 03-18-2005 06:59 AM
remane a file that begins with $$$ westcoldspring UNIX for Dummies Questions & Answers 3 11-01-2004 02:24 PM
what is the . and .. directories ? ssmian UNIX for Advanced & Expert Users 8 03-02-2004 01:30 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 07-10-2007
Registered User
 

Join Date: Jul 2007
Posts: 5
how to tar directories that begins with 'sample_ZZZ'????

Hi,

I have a bunch of images (8k) in several directories. I want to tar these directories up and unzip them to development and production with the same path.

Example:

/about/images/sample_01
/about/images/sample_02
/about/images/sample_03
/about/images/lorem_ipsum
/about/images/lorem_ipsum2
...
...

How would I tar up all the directories that begin with 'sample_'?

Thanks for your help.
Reply With Quote
Forum Sponsor
  #2  
Old 07-10-2007
Registered User
 

Join Date: Feb 2006
Posts: 65
Smile

I'm guessing that all the sample_* directories are under /about/images
cd to the /about/images and the run the following:

Code:
tar cvf sample.tar sample_*

This will create a /about/images/sample.tar file.

View the table of contents of your tar file to see if all the directories and sub-directories are intact:

Code:
tar tvf sample.tar

Run the following on your production or development environment

tar xvf sample.tar
Reply With Quote
  #3  
Old 07-10-2007
Registered User
 

Join Date: Jul 2007
Posts: 5
Correct. Let me try and report back. Thanks for your response!
Reply With Quote
  #4  
Old 07-10-2007
Registered User
 

Join Date: Jul 2007
Posts: 5
Ok, I was able to the tar the directories correctly however... when I went to un-tar it, i got the following error message:

tar: can't set time on genga_58: Read-only file system
tar: genga_title.html - cannot create
tar: genga_title.pff - cannot create
tar: genga_title.txt - cannot create
tar: zoomifyViewer.js - cannot create
tar: can't set time on genga_title: Read-only file system

i cd to my destination and did the following cmd:

tar -xvf /xxxxxxx/xxxxxxxxxx/genga.tar

Can some one hep with the un-tarring? Thanks!
Reply With Quote
  #5  
Old 07-10-2007
Registered User
 

Join Date: Feb 2006
Posts: 65
Smile

Below is my assumption on what is happening and what could be done...

Are you running the below command from the root [/] ? If you are then you need write permissions on the root directory? The below command means that you are trying to extract all the files and directories to the root directory.

tar -xvf /xxxxxxx/xxxxxxxxxx/genga.tar

I would suggest to 'cd' into /xxxxxxx/xxxxxxxxxx/ and run:

tar -xvf genga.tar

This will try to extract your files and directories to /xxxxxxx/xxxxxxxxxx/ where I guess you have the write permission.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0