Visit Our UNIX and Linux User Community


UNIX Batch FTP Command file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers UNIX Batch FTP Command file
# 1  
Old 08-13-2002
UNIX Batch FTP Command file

Hello, I am a UNIX newbie and this is my first posting.

I need to create a batch command file to ftp from Sun/Solaris to AS/400.

Here is an example file:

ftp -d -i -n -v 172.28.16.22
pwd
ls
binary
quit

This is the result of executing the command file:

Connected to 100.10.10.100.
220-QTCP at AS400-TEST.test.test.com.
220 Connection will close if idle more than 5 minutes.
---> QUIT
221 QUIT subcommand received.
/test/ts000415
stderr.log
stdout.log
sysh.tmp
/p7f800.bat: binary: not found
/p7f800.bat: quit: not found

It appears that a QUIT command is automatcially generated and the pwd and ls commands are not operating on the remote syste but on the local one.

Note, I have a .netrc file in my UNIX home directory with machine, login and password.

Any help would be appreciated.

Thank you,

Pietro
# 2  
Old 08-13-2002
One thing that is wrong is you are using -n in the ftp command. Read the man page on ftp. The -n tells it to NOT attempt an auto-login (ignores .netrc).
# 3  
Old 08-13-2002
OK. I removed the -n. Logged in successfully but still QUITting.

Connected to 100.10.10.10.
220-QTCP at AS400-TEST.test.test.com.
220 Connection will close if idle more than 5 minutes.
---> USER FTPUSER
331 Enter password.
---> PASS test99
230 FTPUSER logged on.
---> QUIT
221 QUIT subcommand received.
/edatemp/ts000416
stderr.log
stdout.log
sysh.tmp
/test/xxf800.bat: binary: not found
/test/xxf800.bat: quit: not found
# 4  
Old 08-13-2002
Can you ftp to the as400 manually?
# 5  
Old 08-13-2002
Yes, I just ftp's to the AS/400.

I am trying to run the batch file from a telnet session. I've navigated to the directory where my batch file is. I do a ls and I see the file (p7f800.bat). But when I try running it

Machina:/directory > p7f800.bat

I get:

ksh: p7f800.bat: not found

Am I doing something wrong?

Thanks,

Pietro.
# 6  
Old 08-13-2002
Instead of Machina:/directory > p7f800.bat

try Machina:/directory > ./p7f800.bat
# 7  
Old 08-13-2002
I have executed the bat file.

This is the result:

Connected to 100.10.10.100.
220-QTCP at AS400-TEST.test.test.com.
220 Connection will close if idle more than 5 minutes.
---> USER FTPUSER
331 Enter password.
---> PASS blahblah
230 FTPUSER logged on.
ftp> quit
---> QUIT
221 QUIT subcommand received.
./p7f800.bat[2]: lcd: not found
./p7f800.bat[3]: put: not found
./p7f800.bat[4]: quit: not found

I entered the lowesr case "quit" command as it seems ftp is in interactive mode - I would like to automatically continue to the lcd command.

Thanks,

Pietro.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #932
Difficulty: Easy
Most first-generation personal computers did not keep track of dates and times.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

FTP batch file suddenly stopped working

Hello, we have a UNIX system the runs our business data. We have 4 users that use a particular batch command file to extract data for use in the Windows side of the fence: (despreg.bat) ftp ftp> open danapak (database name) connected to danapak ftp> user ccsb password ccsb ftp>... (29 Replies)
Discussion started by: Mick_Dundee
29 Replies

2. Shell Programming and Scripting

How to execute a batch file containing ftp commands??

hi, is there a way i can execute a batch file containing ftp commands like we execute sftp batch file. sftp -b batchfile user@server > output how to create a batch file for ftp executing command and how to run the batch file from a shell script? (2 Replies)
Discussion started by: Little
2 Replies

3. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

4. UNIX for Dummies Questions & Answers

Unix Batch command, and running jobs in queues.

Hello all, I have a quick question. I work in a computational science laboratory, and we recently got a few mac pros to do molecular optimizations on. However, on our normal supercomputers, there are queue systems, mainly PBS. Anyway, the macs obviously don't have PBS, but I've read about... (0 Replies)
Discussion started by: corrado33
0 Replies

5. Windows & DOS: Issues & Discussions

Batch file to Get New Files Only through FTP

Hi there I want to create a batch file which Get (mget) the newly added Files only from specific directory on UNIX server to specific folder on windows server using FTP, and this batch file will be scheduled on the windows server to run daily to load the new files (load the newly added files... (1 Reply)
Discussion started by: alsharq
1 Replies

6. Windows & DOS: Issues & Discussions

Batch file to Get New Files Only through FTP

Hi there I want to create a batch file which Get (mget) the newly added Files only, from specific directory on UNIX server to local folder on windows server through FTP, and this batch file will be scheduled to run daily to load the new files. help me plz :confused: (1 Reply)
Discussion started by: alsharq
1 Replies

7. UNIX for Dummies Questions & Answers

Unix Batch FTP - SAS

Hi All, Im trying to write a Unix FTP batch file within a program called SAS. Now i already have one for windows which works fine, but it doesnt work within unix. I've been told that some of the commands are different from Windows to Unix, and ive looked round and am completely stumped... ... (0 Replies)
Discussion started by: shenniko
0 Replies

8. Shell Programming and Scripting

executing *.bat file on windows from Unix box via ftp command

I have created get_list.bat file containing following line: dir /B /O-d >file_list.txt I am executing ftp command from Unix box and transferring get_list.bat file to windows server. In my next ftp command I am trying to execute this test.bat file by entering this line: get_list or by... (9 Replies)
Discussion started by: alx
9 Replies

9. UNIX for Advanced & Expert Users

batch file equivalent for Unix

i was trying to do a simple batch file equivalent in Unix when i write a single command in a file, give executable permissions and run it (i gave the file name as a command at the prompt), it works fine. but when i have more than 1 command, say my file has a.out ls ls a.out it doesnt... (1 Reply)
Discussion started by: megastar
1 Replies

10. UNIX for Dummies Questions & Answers

Batch files and FTP under Unix

Hey all, Does anyone know if Unix has an equivalent to a batch file? And if so, does it work the same way as a batch file under windows? AND, if you can answer that one, is it possible to run such a file under HP-UX and have it execute while in an FTP command line? What I need to do is... (4 Replies)
Discussion started by: ober5861
4 Replies

Featured Tech Videos