unix automatic file transfer


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users unix automatic file transfer
# 1  
Old 11-13-2005
Question unix automatic file transfer

Hello,
I am a beginner with korn shell scripting. I have got a text file that gets produced every night and I need to transfer it to a windows shared area.
Is there any command line script (e.g FTP) that I could use to transfer the file automatically without manual intervention everyday?
Any ideas will be very much appreciated

Thanks
# 2  
Old 11-14-2005
what about your ksh script are you gonna launch it once and for all or everyday ?
# 3  
Old 11-14-2005
The ksh script will be run everyday.

Thanks
# 4  
Old 11-14-2005
FTP example

Here's a way to call ftp inside your ksh script:


Quote:
#!/bin/ksh

# you have to set the variables here
# HOSTNAME=the windows machine
# USER/PSSWD: the username and password
# REP_SRC: the source folder
# REP_DEST: the destination folder
# FILENAME: The file you want to transfert

rm -f log_file.tmp

ftp -i -n -v <<EndFTP >>log_file.tmp 2>>log_file.tmp
open ${HOSTNAME}
user ${USER} ${PSSWD}
a
lcd "${REP_SRC}"
cd "${REP_DEST}"
mput "${FILENAME}"
EndFTP

# the file log_file.tmp will contain the logs of the ftp operation
# you can check it by using the grep
# end of the scrpit
See the man for ftp for further information

(ps: no spaces or tabs before the final EndFTP)
# 5  
Old 11-14-2005
Majid,
Thanks for your script. I'll try this and let you know.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File Transfer from Window server to UNIX and UNIX to UNIX

Dear All, Can someone help to command or program to transfer the file from windows to Unix server and from one unix server to another Unix server in secure way. I would request no samba client. (4 Replies)
Discussion started by: yadavricky
4 Replies

2. UNIX and Linux Applications

UNIX to windows XP file transfer

I am using Unix workstation to transfer a .txt file to my other Windows XP desktop using network. can u suggest some idea how to do. i am new to unix . (4 Replies)
Discussion started by: senthil17
4 Replies

3. Shell Programming and Scripting

Transfer file from UNIX to MFT system

Hello , I need to write a script that by using scp transfer a csv file from UNIX to a MFT system (MFT is similar to a winscp) with the help of a private/public key. problem is we are not suppose to generate a private key that will be provided to use by an Application team. Can anybody help me... (0 Replies)
Discussion started by: Monika08
0 Replies

4. UNIX for Advanced & Expert Users

UNIX - SCP File Transfer

Hi, How do i know if the files are transferred succesfully when i use SCP to transfer files between 2 servers. One more is i am trying to send all the files in a single shot by using * to save the connection time. So can i know when the scp breakes in the middle scp $sourcepath/*... (9 Replies)
Discussion started by: vijaykrc
9 Replies

5. UNIX for Dummies Questions & Answers

transfer file from unix to windows on same PC

Hi, Do any one know the shell script code to transfer a file from unix to windows on same PC (4 Replies)
Discussion started by: monika
4 Replies

6. Shell Programming and Scripting

to transfer a file from unix to window

Hello sir/Madam, I m writing in unix prompt folllowing- >ftp <local ip> // my pc ip is 10.64.0.59 Then following message is displayed- "ftp: connect: Connection refused" Please help me to solve this problem. Thanking you. (3 Replies)
Discussion started by: Nirmal
3 Replies

7. Shell Programming and Scripting

Transfer FILE from UNIX to WIN2000/XP

it's possible make a transfer file with a remote command from UNIX SYSTEM to another computer with WIN2000/XP ??? ex.(rsh,ssh ecc.....????) now i use FTP program or telnet connection but ,i find a solution for execute a transfre file in to shell script UNIX (sh or ksh) from windows system (2 Replies)
Discussion started by: ZINGARO
2 Replies

8. Shell Programming and Scripting

Perl scirpt for automatic file transfer

Hi , can any one help me with a perl script for automating file transfer ? At each step i need to check for the success or failure . I am trying to connect to the target system for a specified number of times.if it doesnt connect even after 3 retries then the script should exit. and i have to... (8 Replies)
Discussion started by: sveera
8 Replies

9. UNIX for Dummies Questions & Answers

unix to winnt file transfer

how to pass files from unix to windows nt?help (8 Replies)
Discussion started by: srinivasanvs
8 Replies

10. IP Networking

File transfer from unix to NT box?

Is there a method to transfer a file from UNIX (AIX) to an NT box without the NT box having any special software running? I can ping the box via the network and I have a valid NT account to use. Is FTP a viable solution ? HELP! (10 Replies)
Discussion started by: jvacc
10 Replies
Login or Register to Ask a Question