1829265 Members
1543 Online
109988 Solutions
New Discussion

files dowbload using FTP

 
SOLVED
Go to solution
Ramana.Sv
Frequent Advisor

files dowbload using FTP

Hi,
i written a shell script to download files forom another screver to my server, for that iam using "crontab" to run the script. but my problem is total script is not executing why? its its saying *.* drectory is not found error and remote Directory is not found like that pls go through the attachment please.
i set crontab Like this

12 02 * * * sh /abc/test.sh


Thank you,
10 REPLIES 10
Ivan Krastev
Honored Contributor

Re: files dowbload using FTP

Afte 'user $uid $passwd'
add
'prompt off'

before first mget


regards,
ivan
Ramana.Sv
Frequent Advisor

Re: files dowbload using FTP

prompt off mean iam not getting.
just asking for knowledge sir... pls tell me sir...


Thank you,
Aneesh Mohan
Honored Contributor

Re: files dowbload using FTP

Hi Ramana,

Can you try the attached script ( change the required parameters)


Thanks,
Aneesh
Aneesh Mohan
Honored Contributor

Re: files dowbload using FTP

Hi again,

sorry the script was not attached , pls check now.
Dennis Handly
Acclaimed Contributor

Re: files dowbload using FTP

You didn't use $ftpsrv on your ftp command.

>'prompt off' mean i am not getting.

Also as Ivan said, you may need to add the command:
prompt off
After your "user" command. (I don't see it making a difference.)

If there are no files to get, I get:
*.*: No such file or directory.
can't find list of remote files: No such file or directory

Note that *.* requires there to be a ".". For unix, if you want to copy all files, you need just a *.

>Aneesh: Can you try the attached script

I'm not sure how using "quote USER" is any better than putting both on the "user" command?
Ramana.Sv
Frequent Advisor

Re: files dowbload using FTP

What is "quote USER " means pls sir...
Dennis Handly
Acclaimed Contributor

Re: files dowbload using FTP

>What is "quote USER " means ... is it required or not?

Well, I don't think you need it, you should work fine without it. You got past that login step.
Ramana.Sv
Frequent Advisor

Re: files dowbload using FTP

When i use the "crontab " i got the following error why? where is the mistke i have done pls tell me sir...
i send my shell script in before message pls check that sir....


******************************************
Output
******************************************
Interactive mode off.
Local directory now /prod/pub
*.: No such file or directory.
can't find list of remote files: No such file or directory
Local directory now /prod/weblib
Local directory now /prod/pub
*.: No such file or directory.
can't find list of remote files: No such file or directory
Local directory now /prod/weblib
*.: No such file or directory.
can't find list of remote files: No such file or directory
Local directory now /prod/weblib
*.: No such file or directory.
can't find list of remote files: No such file or directory
Local directory now /prod/pub
*.: No such file or directory.
can't find list of remote files: No such file or directory
Local directory now /lee/weblib
*.: No such file or directory.
can't find list of remote files: No such file or directory
Local directory now /lee/pub
*.: No such file or directory.
can't find list of remote files: No such file or directory


*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

sh /hai/test.sh
Dennis Handly
Acclaimed Contributor
Solution

Re: files dowbload using FTP

>When i use the "crontab" i got the following error why?
*.: No such file or directory.

You might want to use the "ls" command to show what files are there.

But it appears you saw "*." and used that. The "." was the end of the sentence, not part of the syntax you needed. So you need:
mget *
Arturo Galbiati
Esteemed Contributor

Re: files dowbload using FTP

Hi Ramana,
I tested this script (first part of yours) and on HPux11i it ran correctly:

ftpsrv=localhost
uid=galbiati
passwd=mypass
ftp -nv $ftpsrv<user $uid $passwd
lcd prod/weblib
!pwd
cd cad/weblib
pwd
ls -l
prompt off
mget *
close
bye
endftp

10:44 root/home/galbiati/> ftpx
Connected to localhost.bbn.hp.com.
220 hpbbnn1.bbn.hp.com FTP server (Version 1.1.214.4(PHNE_34544) Fri Feb 24 15:03:24 GMT 2006) ready.
Remote system type is UNIX.
Using binary mode to transfer files.
331 Password required for galbiati.
230 User galbiati logged in.
Local directory now /home/galbiati/prod/weblib
/home/galbiati/prod/weblib
250 CWD command successful.
257 "/home/galbiati/cad/weblib" is current directory.
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 0
-rw------- 1 galbiati ermsupp1 0 Oct 10 10:35 a
-rw------- 1 galbiati ermsupp1 0 Oct 10 10:35 a1
226 Transfer complete.
Interactive mode off.
local: a remote: a
200 PORT command successful.
150 Opening BINARY mode data connection for a (0 bytes).
226 Transfer complete.
local: a1 remote: a1
200 PORT command successful.
150 Opening BINARY mode data connection for a1 (0 bytes).
226 Transfer complete.
221 Goodbye.
10:44 root/home/galbiati/>


Note: I added -v (verbose) option, !pwd, pwd, ls -l to better debug the script. To transfer file a, a1 you should use mget * only.


HTH,
Art

N.B. please assign points!