Solved

moving files around

Posted on 2002-03-03
7
210 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
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 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…
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.

805 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