Solved

Transferring files while preserving permissions

Posted on 1998-04-28
8
438 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now