Solved

moving files around

Posted on 2002-03-03
7
208 Views
Last Modified: 2013-12-27
Hi..

 i try to move one large .dmp file
 to other disk space.

 let say from /export/m.dmp to /tmp directory

 in export the files is owned by sysops
 
 $ -rwxr-xr-x   1 sysops   dba

 when i cp the file to /tmp

 the owner is root.

 i try to move using sysops id but get error
 'no permission,access denied'

 how can i grant back the file to sysops.

 tq
 sun newbie
0
Comment
Question by:ismahwati
7 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 6838433
If you use cp command, the file permission will change, use
the tar command instead.

  delete the file in tmp first,
     rm /tmp/m.dmp

  make a copy of the file in /export, and put it to /tmp,

  cd /export
  tar cf - m.dmp  | (cd /tmp ; tar xvf -)

  the above commands will do the job for you.

=====
yuzh
0
 
LVL 4

Expert Comment

by:Otetelisanu
ID: 6838520
Use
cp -p file newfile
with p the owner and group
is same
0
 

Author Comment

by:ismahwati
ID: 6838548
i try the cp -p file newfile..

but i does not maintain the owner
it change  the sysops to root / other.

 tq
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 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 6838895
-p option works for Sun's propietary /usr/xpg4/bin/cp only.

Either use the given tar solution, or make
   chown sysop newfile
after copying.
0
 

Author Comment

by:ismahwati
ID: 6840982
tq
it helps
0
 

Author Comment

by:ismahwati
ID: 6840983
tq
it helps
0
 

Author Comment

by:ismahwati
ID: 6840985
tq
it helps
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

747 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

18 Experts available now in Live!

Get 1:1 Help Now