Link to home
Start Free TrialLog in
Avatar of peter_chong
peter_chong

asked on

Autodownload multiple files from batch

Dear EE member,
I can't download multiple files automatically via batch in Windows XP Pro. Here is the output:

ftp> open 10.1.1.1
Connected to 10.1.1.1.
....
User (10.1.1.1:(none)):
331 Password required for oracle.

230 User oracle logged in.
ftp> ascii
200 Type set to A.
ftp> cd /home/oracle/testdata
250 CWD command successful.
ftp> get reserveStock.csv
200 PORT command successful.
150 Opening ASCII mode data connection for reserveStock.csv (59584 bytes).
226 Transfer complete.
ftp: 60032 bytes received in 1.10Seconds 54.57Kbytes/sec.
ftp> get inventory.csv
Error opening local file inventory.csv.
> inventory.csv:Permission denied
ftp> quit
221 Goodbye.
finish.
Press any key to continue . . .

Any idea?

Regards,
Peter
Avatar of yuzh
yuzh

It could be the file permission problem!

Could you please use (shell login, eg ssh, telnet to the server)
then
cd /home/oracle/testdata

do a
ls -al inventory.csv
to find out.
Avatar of peter_chong

ASKER

$ ls -al inventory.csv
-rwxr-xr-x   1 oracle     dba          11970 Aug  8 17:44 inventory.csv
$ ls -al reserveStock.csv
-rwxr-xr-x   1 oracle     dba          59584 Aug  8 17:46 reserveStock.csv

Anything wrong?

I can ftp the files manually, but not using batch.

Regards,
Peter
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My FTP command is from Windows XP Pro.

The following output come up after I use mget
command.

ftp> open 10.1.1.1
Connected to 10.1.1.1.
220 oracle FTP server (Version 1.1.214.7 Thu Aug 10 09:57:38 GMT 2000) ready.
User (10.1.1.1:(none)):
331 Password required for oracle.

230 User oracle logged in.
ftp> ascii
200 Type set to A.
ftp> cd /home/oracle/testdata
250 CWD command successful.
ftp> prompt
Interactive mode Off .
ftp> mget reserveStock.csv inventory.csv
200 PORT command successful.
150 Opening ASCII mode data connection for reserveStock.csv (59584 bytes).
226 Transfer complete.
ftp: 60032 bytes received in 1.13Seconds 53.27Kbytes/sec.
Error opening local file inventory.csv.
> inventory.csv:Permission denied
ftp> bye
221 Goodbye.
Dear EE members,
I know the cause - My application is locking the inventory.csv while the ftp process has not completed.

Can I add file locking condition in batch file, so that
once the files download complete, only other applications can share the csv files.

Extra point will be granted, if this is possible.

Thank you.

Regards,
Peter
Have a look at this doc:
http://www-05.ibm.com/de/support/ecurep/problems.html
to see if it can help.
You have permission problem in place where you try to save files on XP box. No problem with FTP server or session as such.