The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Automate FTP borncrazy Shell Programming and Scripting 11 02-20-2008 09:10 PM
automate Telnet ? tbeghain Shell Programming and Scripting 4 06-19-2007 03:09 AM
How to automate an FTP process? ksak Shell Programming and Scripting 1 10-06-2006 09:45 AM
How to automate responses djp Shell Programming and Scripting 2 06-07-2005 01:00 PM
Automate FTP CamTu UNIX for Advanced & Expert Users 4 02-25-2005 07:08 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 07-23-2002
flowrats
Guest
 

Posts: n/a
Unhappy

perhaps if I keep is simpler and create the .netrc manually, but
how to kick off the macdef init?

machine mainframe login demo password demo macdef init
get "fileone"

would this work?

Thanks
Forum Sponsor
  #9  
Old 07-23-2002
Registered User
 

Join Date: Jul 2002
Posts: 7
in giannicello's script I noticed that there are two if's and only 1 fi
the script might work if you add another fi to end the statement
sorry if you allready tried it
Mike
  #10  
Old 07-23-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
By searching this site for "automated ftp jobs", I found this old post of mine. You simply need to replace the "print -p put tar.gz" line with:
print -p get \'111.111.111.111\'
print -p get \'222.222.222.222\'

I created two files with those names and just ran the script. It worked.
  #11  
Old 07-23-2002
Registered User
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
I also would put a sleep command between each upload (especially if they are large files)...makes it safer that each will be completed.

Also you haven't said whether or not there would be any other filenames of this 'format' as you put it. If there are no other files that start 111 in the directory - then a simple mget \'111* would suffice and you could just put the sleep command after this before you exit. If this is the case use ftp -i (to turn off the interactive prompting for mget).
__________________
Pete
  #12  
Old 07-24-2002
flowrats
Guest
 

Posts: n/a
Cool automate an ftp job

Thanks all,

It works now using this script:

#!/usr/bin/ksh
ftp -v -n "mainframe" << cmd >> ftplog
user "userid" "password"
get '111.111.111.111.111' file1
get '222.222' file2
get '33.33.33' file3
quit
cmd

flowrats
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0