Solved

Transferring files while preserving permissions

Posted on 1998-04-28
8
441 Views
Last Modified: 2010-04-21
Hi.

I have lots of files on one server and need to transfer them to another while preserving all permissions.
I tried tarring them up with :- tar -cfvp file.tar my_folder and it worked a little.. some of the files had permissions of 777 but TAR did not preserve them.. How do I get around this?
0
Comment
Question by:missy041598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 4

Expert Comment

by:jos010697
ID: 2006480
This is what my man page (AIX 4.2) says about tar's -p flag:

-p      Says to restore fields to their original modes, ignoring the present
umask. The setuid, setgid, and tacky bit permissions are also restored
to the user with root user authority.

Is this what you're looking for?

kind regards,

Jos aka jos@and.nl

0
 

Author Comment

by:missy041598
ID: 2006481
Yes, I understand this but I did have the "p" in the above example I have included
and it still didn't work.
0
 
LVL 4

Expert Comment

by:jos010697
ID: 2006482
I guess I included too much from the man page; just the last line was important here:
were you logged in as root while transfering the data? If not, check (and unset)
your umask ...

kind regards,

Jos aka jos@and.nl
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:missy041598
ID: 2006483
Hi.

Yes I was logged on as root. How do I unset my unmask? Sorry im not very experienced with this. Do I need to unset my unmask when tarring or when untarring?

Thanks for your help. Looks like we are getting somewhere, hopefully I will be right soon.

0
 
LVL 4

Expert Comment

by:jos010697
ID: 2006484
umask is a command (usage: 'umask 000' to unset all mask bits), but I think I've
got it now after rereading your question: you have to use the -p flag when
 _extracting_ the files, not when _creating_ the archive

(I guess I need glasses or something ;-)

kind regards,

Jos aka jos@and.nl
0
 

Author Comment

by:missy041598
ID: 2006485
Hi..

Thanks soooo much! You have really helped. Answer the question and i'll give you your much deserved points.

Thanks again.
0
 
LVL 4

Accepted Solution

by:
jos010697 earned 50 total points
ID: 2006486
Ok, here goes ... thanks for the points

Jos aka jos@and.nl
0
 

Author Comment

by:missy041598
ID: 2006487
Thanks again.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question