?
Solved

moving files around

Posted on 2002-03-03
7
Medium Priority
?
216 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
[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
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
Independent Software Vendors: 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!

 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.
Suggested Courses
Course of the Month9 days, 10 hours left to enroll

762 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