views:

33

answers:

1

I have a folder on my server that I'd like to copy to another directory. However, after I copy it and navigate to the new folder, some of the directories are RED and I can't navigate into them. I think this has something to do with them creating links instead of actually copying the folders.

cp -a site2.com/httpdocs site1.com/httpdocs

But then some of the sub folders from site2.com/httpdocs are setup as invalid links into site1.com/httpdocs and I cannot navigate to them nor can the webserver display them.

Additionally, I have a permissions error where the copied files have their user set to site2.com but even after CHOWN I cannot get site1.com to display them.

A: 

You might want to use the -L argument to cp in order to follow the symbolic links. The cost is that you will create a copy where you otherwise might have been able to get away with a link (e.g. by correcting the link target), which takes disk space.

I don't think you've provided enough info to address the permissions error. You'd want to compare 'id -Z' with 'ls -lZ filename' to make sure the owner, permissions, and security context are all right. You might want to check the permissions of the directory you're working in, also.

Slartibartfast