auto ftp the files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting auto ftp the files
# 1  
Old 12-18-2006
auto ftp the files

i have writen a shell to ftp a file automatically by taking the input from a file

i have created on file tstftp as


set timeout 120
ftp
spawn ftp
expect "ftp>"
send "o 11.90.2.20 \r"
expect "Name:"
send "itcomxxl\r"
expect "Password:"
send "csms091206\r"
expect "ftp>"
send "prompt no"
expect "ftp>"
send "mput \obdtl.sql\r"
expect "ftp>"
send "close\r"
expect "ftp>"
send "bye\r"


if i execute the shell ftptst ,after executing the second line ftp it is not accepting the remaining values please give me the solution
# 2  
Old 12-18-2006
no need to use expect in ftp:

Code:
ftp -ivn 11.90.2.20 << eof
user itcomxxl csms091206
prompt no
mput obdtl.sql
bye
eof

next time use search function Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Need HELP] Find aging file and auto FTP

Dear Experts, I have script to find aging file like this: find /ArchiveINTF/INTF name "*" -type f -mtime +365 {} \; >> agingfile.txt This script will find all files over 365 days. But, I have problem, how to auto FTP all files? Thanks Edy (3 Replies)
Discussion started by: edydsuranta
3 Replies

2. Shell Programming and Scripting

Auto Ftp pseudo random file

I have a script that generates a file which is my own incarnation of a date using the 'date' function (we'll call this script a). I would like that script to invoke my other script (script b) which contains my ftp info. Since I have yet to figure out a good way to use regular ftp (yes i can only... (6 Replies)
Discussion started by: DC Slick
6 Replies

3. Shell Programming and Scripting

Help with auto-detect new files/folders then zip and move script

Hello, I need a simple script to Auto-detect new files and folders in the directory. And then I need to zip the new files and bzip2 new folders and move them out of that folder where I am detecting changes to the other folder. Remember, I need simple one. If anyone could do it fast, I may... (1 Reply)
Discussion started by: juzt1s
1 Replies

4. Shell Programming and Scripting

Auto sending text files from SCO box to a PC via serial cable

I have an SCO system with several PC's hooked up via ProComm and serial cabling (no Ethernet). I want to occasionally transfer a small text file from the UNIX system to a specific PC without the PC operator having to do anything (she may be out to lunch or doing other work during the transfer) ... (0 Replies)
Discussion started by: gbrowne
0 Replies

5. UNIX for Advanced & Expert Users

Count and Auto FTP

Hi, I really need to create a script that counts for file and ftp's them to a windows directory. !st problem i'm having is getting it to ftp withouty prompting me, i tried |& on the end of the ftp, but then it just hits a syntax error. 2nd problem is, i have to have a wildcard in this script. which... (3 Replies)
Discussion started by: dappa
3 Replies

6. Programming

Auto FTP from UNIX to Windows Server

Hi, I am a not strong programmer and now my boss ask me how should I do a job to automated FTP that have error check. I know about: * using system() to call a command to trigger ftp in C Coding. The senarios as follows: 1. FTP the file(s) (e.g ELA_20060407.dat) to a given LAN server... (1 Reply)
Discussion started by: songtam
1 Replies

7. Shell Programming and Scripting

Auto FTP to a server

Hi, I am trying to automate FTP login to a remote server and put a file there. But no matter what i do, It still is aksing me for the login and password although i have it defined in the variable. Could you tell me what is wrong with this script. I am doing this on SUN server. Pls... (11 Replies)
Discussion started by: systemali
11 Replies

8. Solaris

Auto delete files in /tmp dir ???

I have a Solris 9 box my problem is when I restart my box all my files and dirs in /tmp dir will be deleted exept 2 directories I found them since installation phase !!!! How to keep my files at that dir " /tmp " even after restarting ??? (1 Reply)
Discussion started by: DarkSoul
1 Replies

9. UNIX for Dummies Questions & Answers

An Auto-Login "ftp" Script

We are running SCO Unix under Unixware 2.1.3 (really old!). I would appreciate if someone could show me the code of a script to automatically "ftp" one or more files to another SCO Unix computer on the nightly basis, then gracefully termninate the ftp session. Thanks for your help. (3 Replies)
Discussion started by: tphan
3 Replies
Login or Register to Ask a Question