Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > TAR Question

TAR Question
Thread Tools
BoulderDash
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Feb 12, 2006, 05:35 PM
 
Hi there,
Can someone please give me the "tar" command to do the following:

1) Copy every file in the current directory I am in (including: "dot" files, refular files, directories and subdirectories - basically... everything)

2) Maintaining the ownership for the above files, as is

3) Maintaining the permissions for the above files, as is

I'm way new to UNIX commands and need to copy all of the files from one domain to another. Everything is exactly how I want it at domain "A" - but I need to copy it over to domain "B". I figure I can download the tar file from "A" and upload it to "B." Any help?

Thanks,
BD

* P.S. Also, the "untar" command (for once I take the tar file and upload it to the other directory) would be helpful. I think it's just another "tar" command, but with different letters.
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Feb 12, 2006, 05:47 PM
 
Please read the man page for tar and make an effort to figure out both commands on your own. I'll help you if you get stuck, but the best way to learn is by doing.
     
BoulderDash  (op)
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Feb 12, 2006, 07:06 PM
 
Hey,
That's great... I wish I knew what a man page was, before you linked me to it. This is akin to my asking how to say something in Spanish, and being pointed to a Spanish dictionary. I'm trying, but I do not understand. Does this look correct:

tar cvf dbA_backup.tar *

And then:

tar xvf dbA_backup.tar

I'm trying to get it... but command line is not what I do (thus, the Mac). Thanks if you can help,
BD
     
BoulderDash  (op)
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Feb 12, 2006, 07:28 PM
 
Ahh... forget it, I guess. My commands listed above do not keep ownership or permissions. I'll have to post somewhere else.

I'm all for learning by doing, but this isn't the time or place for me to dissect what a "man" page is... I just needed help with two UNIX commands. Not help on taking the time to learn UNIX. I didn't ask top be taught, I asked to be helped.

BD
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Feb 12, 2006, 07:46 PM
 
"man" page is short for manual pages; most unix-like OSs include them to help users with the variety of unix commands.

This thread probably belongs in the UNIX forum anyway.
     
BoulderDash  (op)
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Feb 12, 2006, 07:50 PM
 
Wow... thanks for all of your help.

BD
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 13, 2006, 02:15 PM
 
The -p flag will preserve permissions. Add that to the commands you listed above and they should work. But in order to extract files with the original owners in place (rather than owned by the user that extracted them), you'll have to use sudo tar rather than just tar when you extract them, since only root can set ownership. You might want to consider whether you actually want to keep the same owner, though — "same owner" could be kind of meaningless across machines.

As a side note, it's pretty rude to tell people, "I don't want you to help me solve the problem myself; I just want you to do all the work for me." People don't like to feel like they're being used. More politeness will go a long way toward winning people over and making them offer more help of their own accord.
( Last edited by Chuckit; Feb 13, 2006 at 03:21 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 09:34 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,