?
Solved

Transferring files while preserving permissions

Posted on 1998-04-28
8
Medium Priority
?
446 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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 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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

743 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