[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

cp-issue in unix

Posted on 2011-10-26
8
Medium Priority
?
342 Views
Last Modified: 2012-06-27
When i try
cp /home/njifcip/stmtpim/wmr/* /home/nyistpp/stmt/data/wmr/
cp: cannot create regular file `/home/nyistpp/stmt/data/wmr/abc.txt': Permission denied

Why i am getting this error.
Both path have wmr directory full permission.
I created test dir under wmr and could perform successful copy
Please advise.

0
Comment
Question by:sunilbains
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37032615
Could it be that the source of "abc.txt" is a symbolic link pointing to a file you don't have read permission to?

Check with

ls -l /home/njifcip/stmtpim/wmr/abc.txt

If it's indeed a link use the "-P" flag to copy links as links, if appropriate.

wmp
0
 

Author Comment

by:sunilbains
ID: 37032693
i tried ls -l /home/njifcip/stmtpim/wmr/abc.txt

and getting following output
-rw-r--r--    1 njifcip  pcs-tech--1   717336 Oct 22 02:09 /home/njifcip/stmtpim/wmr/abc.txt
Does not seem to be link?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37032715
Right.

What do you get with

ls -ld /home/nyistpp/stmt/data/wmr

and

id

?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:sunilbains
ID: 37033444
$ ls -ld /home/nyistpp/stmt/data/wmr
drwxrwxrwx    5 nyistpp  games        4096 Oct 26 12:34 /home/nyistpp/stmt/data/wmr
wmr]$ id
uid=72619(nyoteapb) gid=20(games) groups=20(games)
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 37033503
the dir is owned by other user nyistpp  and file abc.txt is owned by other user njifcip and you have read only on that file
0
 
LVL 19

Expert Comment

by:xterm
ID: 37033516
/home/njifcip/stmtpim/wmr/abc.txt already exists and is owned by another user, so you cannot overwrite it, however you are still permitted to create new files or directories because /home/njifcip/stmtpim/wmr is world-writable.  This is exactly how the system should act.
0
 

Author Comment

by:sunilbains
ID: 37033726
Hello xterm,
what is the alternative solution?
 should we have 777 permission on tgt-- /home/nyistpp/stmt/data/wmr/ existing files.
0
 
LVL 19

Accepted Solution

by:
xterm earned 2000 total points
ID: 37033885
If you chmod 777 /home/nyistpp/stmtpim/wmr/abc.txt, then yes, you will be able to overwrite it, but it's new permissions will now become exactly what the permissions are of /home/njifcip/stmtpim/wmr/abc.txt.

Course you will have to be root to do that, and if you're going to do that, you might as well just rm  /home/nyistpp/stmtpim/wmr/abc.txt and get it out of the way.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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…
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
Course of the Month19 days, 16 hours left to enroll

872 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