Solved

Transferring files while preserving permissions

Posted on 1998-04-28
8
437 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

707 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

16 Experts available now in Live!

Get 1:1 Help Now