Operating System - HP-UX
1834650 Members
2272 Online
110069 Solutions
New Discussion

HP-UX 8.0.0 error while copying

 
Sunil Kalachar
New Member

HP-UX 8.0.0 error while copying

Hi

I am working on an project for Nortel Networks. I would like to know the following. I just got this email address
from one of the hp links.

In HP-UX 8.0 , I am getting this error in the shell script . This is happening once in thousand times.


cp: cannot overwrite existing directory /iws/ahd

Shell script is :

#! /bin/csh

set NATIVE_SYS="/iws/native_sys"

cd $NATIVE_SYS
set NATIVE_LIST=`ls -1`

foreach entry ($NATIVE_LIST)
if (-d /iws/$entry) then
mv /iws/$entry /iws/$entry.tmp >& /dev/null
endif
cp -r $NATIVE_SYS/$entry ~/iws/
end


May I know when will the system throughs such warnings.

Note : /iws is an symbolic link.


Please letme know why is this happening. If i am asking the wrong person , please direct me to the correct
person.


Thanks In advance. Your response will be apreciated.

Best Regards
--sunil
5 REPLIES 5
Tim Malnati
Honored Contributor

Re: HP-UX 8.0.0 error while copying

The most like reason is the existing ownership/permissions of /iws/ahd. Does the user running this script own that directory and everything under it?

Are you really running under HPUX 8.0? This is a bad situation if you are where it is not supported in any way and is definitely not Y2K compliant. HP had a deal where many machines that were not capatable of moving to 10.x could use a special Y2K compliant version - 9.10 if I remember correctly. I hope this work that you are doing for Nortel does not need to be imported to their machine where there is a good possibility that it may not work as expected.
Sunil Kalachar
New Member

Re: HP-UX 8.0.0 error while copying

This script is being run by root user. As i have mentioned this does not happen everytime.
Dan Hetzel
Honored Contributor

Re: HP-UX 8.0.0 error while copying

Hi Sunil,

You must be one of the few still running HP-UX 8.0...

If the user running the script is always root, then in the following statement:
cp -r $NATIVE_SYS/$entry ~/iws/
the ~/iws/ could be replaced by /iws , without the ~ and the trailing backslash.

As I've been using Unix for 20+ years, I remember that, for no reason, cp was sometimes complaining when the destination directory had a trailing backslash.
This could be the reason but, don't ask me where I've seen that written, it's ages ago ;-)

Best regards,

Dan

PS: I concur with Tim, you should definitely try to put your hands on a Y2K compliant version, or upgrade to 10.x if your system allows it.
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Dan Hetzel
Honored Contributor

Re: HP-UX 8.0.0 error while copying

Oops, please read 'slash' instead of 'backslash' !
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Sunil Kalachar
New Member

Re: HP-UX 8.0.0 error while copying

Hi Dan /Tim

Actually , the ~ in the destination is a mistake , when i cut and pasted a part of my script to post this question.

The command is:
cp -r $NATIVE_SYS/$entry /iws/

The only thing is about trailing '/' . But as i have mentioned this kind of error is complaining once in thouand times. What i am not understanding is that being a root user , and executing cp command, this eror may be caused due to what reasons.
If I could come to know when HP 8.0 throughs this kind of error then I could analyse the possbile causes for this rare condition.

I did execute strings command on the cp binary to see that this error is present in cp only in HP 8.0 but not in HP 10.0

We are using HP 10.0 and now we will be moving to HP 11.0 for most of our development activities. But there are some old systems which are in the field running on HP 8.0. This script has to be used for reverting some unwanted changes.

As this problem is not always reproduceable, i am not able to get into a conclusion how to change the script to solve this.

Please clarify. Thanks a lot

Best Regards
--sunil