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 Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
scp automated script gholdbhurg UNIX for Advanced & Expert Users 4 06-26-2008 05:47 PM
Automated shtudown joe1967 Shell Programming and Scripting 5 05-29-2007 05:04 PM
automated ftp. sangfroid Shell Programming and Scripting 10 05-07-2007 08:52 AM
FTP automated? n9ninchd UNIX for Dummies Questions & Answers 6 05-18-2001 07:21 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-25-2002
Registered User
 

Join Date: Jan 2002
Location: Mumbai
Posts: 20
Cool Automated FTP

My requiremnet is to write a FTP script which will ftp a file to a specified ftp url.
How can I automate the process usnig the unix cron.
Forum Sponsor
  #2 (permalink)  
Old 01-25-2002
penguin-friend
Guest
 

Posts: n/a
Try something like this for the ftp script:

#!/usr/bin/ksh
ftp -v -n "YOUR.IP.ADD.RESS" << cmd
user "user" "passwd"
cd /distant/directory
lcd /local/directoryget ssh_install
get ( or put) your files
quit
cmd

All you have to do after is to create the cron

Will that help?

Jason
  #3 (permalink)  
Old 01-27-2002
Registered User
 

Join Date: Jan 2002
Location: Mumbai
Posts: 20
Smile

It was great.
It worked fine.

Milind.
  #4 (permalink)  
Old 05-16-2002
Registered User
 

Join Date: May 2002
Posts: 6
How can we get the exit status of this script so that we know if the ftp was successful? echo $? always returns 0 in this or similar script. I have a similar script which uploads a file to an ftp site but the exit status always returns true whether the file to be uploaded exists or not.
  #5 (permalink)  
Old 05-16-2002
Registered User
 

Join Date: Jan 2002
Location: Mumbai
Posts: 20
Cool

You can write a smilar FTP script.
if you are "putting" a file,
replace the put with ls and see if your file is in there.
if you are "getting" a file,
search for the file in your local directory and you can then
know if the FTP was successfull or not.
  #6 (permalink)  
Old 05-17-2002
Registered User
 

Join Date: May 2002
Posts: 6
I have posted my script as a new thread under the following heading:

Checking the exit status of ftp

The exit status of that script always returns true whether the ftp is successful or not.
  #7 (permalink)  
Old 06-10-2002
Registered User
 

Join Date: Jun 2002
Posts: 9
Question FTP with all directories+all subtrees

Thanks all..
even I was looking for automatic FTP and it worked for me too.
however I still have one problem as how can I FTP all directories with thier respective sub-directories between two hosts.

Its possible as of now but the structer of the directory has to be existing before, so that FTP can put all the files in their respective sub-directories by saying "mget *". But if the directory structure does not exists then FTP "mget *" command only gets files from home to home and not sub-directories and the files existing in the respective sub-directories.

can you all please help ? is there any way ?
Thanks and Regards
Taher
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:07 PM.


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

Content Relevant URLs by vBSEO 3.2.0