The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX - SCP File Transfer vijaykrc UNIX for Advanced & Expert Users 9 04-27-2009 06:03 AM
to transfer a file from unix to window Nirmal Shell Programming and Scripting 3 03-19-2008 04:10 AM
Transfer FILE from UNIX to WIN2000/XP ZINGARO Shell Programming and Scripting 2 08-11-2006 07:38 PM
Perl scirpt for automatic file transfer sveera Shell Programming and Scripting 8 08-19-2005 03:39 PM
File transfer from unix to NT box? jvacc IP Networking 10 06-28-2001 05:44 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-13-2005
tagem tagem is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 3
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 (permalink)  
Old 11-14-2005
Majid Majid is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 8
what about your ksh script are you gonna launch it once and for all or everyday ?
  #3 (permalink)  
Old 11-14-2005
tagem tagem is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 3
The ksh script will be run everyday.

Thanks
  #4 (permalink)  
Old 11-14-2005
Majid Majid is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 8
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 (permalink)  
Old 11-14-2005
tagem tagem is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 3
Majid,
Thanks for your script. I'll try this and let you know.

Thanks
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0