The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sdiff issue - not gathering correct difference thegant UNIX for Dummies Questions & Answers 1 05-07-2008 04:38 PM
HP-UX configuration gathering tool ahaidukov HP-UX 0 08-30-2007 08:51 AM
Add new data using script malaysoul Shell Programming and Scripting 1 02-09-2007 10:03 AM
Gathering system configuration hcclnoodles UNIX for Dummies Questions & Answers 4 10-19-2004 11:10 AM
Gathering info on one line HowardIsHigh Shell Programming and Scripting 5 06-24-2003 04:00 AM

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 07-29-2007
mesoeast mesoeast is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 4
Data gathering script

I am pretty new at shell scripting, but I managed to make a primative shell script to connect from my webserver (bluehost) to an external data server via ftp or sftp or whatever I need. This script is :
Code:
#!/bin/sh
HOST='ftp.host.com'
USER='username'
PASSWD='password'
FILE='file'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
lcd /path/to/lcd
get $FILE
quit
END_SCRIPT
exit 0
This script worked on my machine, but when I uploaded it to try it on bluehost, it did not work. I guess ftp and sftp from the webserver is not allowed (maybe I should have already known this). I am allowed ssh access to bluehost, however. I was wondering if there was any other way to get data from an ftp server, and then put that data to my webserver? Should I be trying a different shell script, or take it an move to something like php or perl? Thank you for any information, I searched the forums and I'm pretty sure there is not an answer to this already.
  #2 (permalink)  
Old 07-29-2007
jgt jgt is offline
Registered User
  
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 452
Does the PATH on the web server include the ftp program?
  #3 (permalink)  
Old 07-29-2007
mesoeast mesoeast is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 4
I'm not 100% sure what you are asking. I put the script into the same directory as the path I'm specifying in lcd. I know it's repetitive, but I wanted to make sure it would d/l to that path. My main problem is that ftp from my web server is disabled, which means that I have to download the data from the external data ftp server, and then upload the data to from my computer to the bluehost webserver. I need a way around this, if there is one. I need to directly get data from the external data server to the webserver, skipping me as the intermediate step.

PS: I do have a public_ftp folder, which I can setup for anonymous ftp, but I don't think this will have anything to do with any solution for my problem.
  #4 (permalink)  
Old 07-29-2007
jgt jgt is offline
Registered User
  
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 452
Am I correct in assuming that you want to initiate ftp on the bluehost web server to collect data from the external ftp server.
Then is the ftp program on the bluehost machine in the path that is available to you?
  #5 (permalink)  
Old 07-29-2007
mesoeast mesoeast is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 4
Yes. I have access to the location where I have the ftp script on the bluehost server, however, I do not think that I am allowed to initate ftp from the bluehost server due to security reasons. I am trying to find an alternative method for getting data automatically to my bluehost server.
  #6 (permalink)  
Old 07-29-2007
jgt jgt is offline
Registered User
  
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 452
I don't do web programming, but, can you supply the data from the external ftp server to the bluehost web page as input data? If there are binary files, use uuencode and uudecode .
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 06:22 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