The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
scp automated script gholdbhurg UNIX for Advanced & Expert Users 5 10-27-2008 01:23 AM
Automated shtudown joe1967 Shell Programming and Scripting 5 05-29-2007 08:04 PM
automated ftp. sangfroid Shell Programming and Scripting 10 05-07-2007 11:52 AM
FTP automated? n9ninchd UNIX for Dummies Questions & Answers 6 05-18-2001 10:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 01-25-2002
shauche shauche is offline
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.
  #2 (permalink)  
Old 01-25-2002
penguin-friend
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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-28-2002
shauche shauche is offline
Registered User
  
 

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

It was great.
It worked fine.

Milind.
  #4 (permalink)  
Old 05-16-2002
psingh psingh is offline
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
shauche shauche is offline
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
psingh psingh is offline
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
taher_n taher_n is offline
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
Sponsored Links
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 02:10 AM.


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