Operating System - HP-UX
1833313 Members
3057 Online
110051 Solutions
New Discussion

problem with automated FTP transfer

 
SOLVED
Go to solution
Alan Meyer_4
Respected Contributor

problem with automated FTP transfer

I am trying to automate the patch analysis ftp transfer to HP withthe following script:

cd /tmp

/tmp/cpm_collect.sh

NODE=`hostname`
PUTFILE="/tmp/${NODE}.fs"

ftp -v -n < open 192.151.52.51
user (username and password removed)
bin
hash
cd "/incoming"
put $PUTFILE
quit
EOF


when I run the script, I get the error message

553 Could not determine cwdir: No such file or directory.

when it attempts to put the file.

Where am I going astray?

Thanks
Alan J Meyer
Unix - Midrange Computing Division
Internal Service Department
County of Los Angeles
Phone: 562-658-4373
FAX: 562-803-1294
E-mail: ameyer@isd.co.la.ca.us

" I may not be certified, but I am certifiable... "
8 REPLIES 8
Mel Burslan
Honored Contributor

Re: problem with automated FTP transfer

your ftp command

cd "/incoming" is not getting interpreted correctly, due to one of the two things:

1. the connected host 192.151.52.51 is treating the " signs literally and looking for a directory called "/incoming"

2. /incoming on this host is not there

I tried to login using my ITRC username and password but it failed due to some reason, so I can not verify which one is which.

when you login to this server manually, i.e. not within a scriopt but using an interactive session, do you see /incoming directory ?

________________________________
UNIX because I majored in cryptology...
Patrick Wallek
Honored Contributor

Re: problem with automated FTP transfer

What if you just omit the / in your cd command and do

cd incoming

Patrick Wallek
Honored Contributor
Solution

Re: problem with automated FTP transfer

By the way, I don't think putting files in the incoming directory will work for patch analysis anymore. Unless you access a different site, that was changed a year or more ago and is totally web based now and requires you to upload each file via your browser.
Steven E. Protter
Exalted Contributor

Re: problem with automated FTP transfer

mkdir /incoming and mount a fileystem on it.

or cd incoming/

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Helen French
Honored Contributor

Re: problem with automated FTP transfer

"553 Could not determine cwdir: No such file or directory" error was in issue with some of the old ftp packages and has been fixed with patches. This was an error due to a bug on the realpath() function.

Install patch PHNE_30989 (s700_800 11.00 ftpd(1M) and ftp(1) patch) for 11.00 or the equivalent for your OS.
Life is a promise, fulfill it!
renarios
Trusted Contributor

Re: problem with automated FTP transfer

Hi Alan,

I think your remote directory is an alias and not a real folder.
It seems to work fine for access via HTTP and also for listing sub-directories by FTP, even for creating new directories within it - just not for uploading files.

Check if the folder is an actual folder please, and give us feedback.

Cheerio,

Renarios
Nothing is more successfull as failure
Alan Meyer_4
Respected Contributor

Re: problem with automated FTP transfer

well, it won't let me do it manually either, and seems that all the files there are 2 years old anyway, so the assumption is that I'll have to go to the http site and do it manually...

Thanks for the help

-a
" I may not be certified, but I am certifiable... "
abhilashrb
New Member

Re: problem with automated FTP transfer

Dear Alan,
I also faced the same problem.
One of the reason for the problem is the absolute lenght of ${NODE} may be long (too logn for the FTP to remember/read). Then the problem comes.
if your user has permissions to change to the directory/path mentioned in ${NODE}, then switch to that dir and take the PUTFILE in a variable and while 'put' use that variable.
pfile=`basename $PUTFILE`
export pfile
......
......
put ${pfile}
It works.... But If you dont have permissions to that dir, then we've to think again..??