Data gathering script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Data gathering script
# 1  
Old 07-29-2007
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  
Old 07-29-2007
Does the PATH on the web server include the ftp program?
# 3  
Old 07-29-2007
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  
Old 07-29-2007
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  
Old 07-29-2007
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  
Old 07-29-2007
I don't do Web Development, 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 .
# 7  
Old 07-29-2007
Do you mean submitting the data through some type of php upload form handler or something? I'm kind of a newbie, lol, not sure what you mean?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

2 Loops gathering input

Greetings all, I have came up with some code, to read an input file and generate a list, here is a sample of what I am working with. The variable $USER will be inputted by the person running the utility. do folder=${line%} echo "$folder $USER done < list.txt sample of list.txt- ... (15 Replies)
Discussion started by: jeffs42885
15 Replies

2. Shell Programming and Scripting

Gathering usage statistics

so i have a script that runs across many servers. i'd like to know how many times this script is being used on each server. the only straight forward, non-intrusive way i can think of doing this is to include a line in the script to make a webcall to a central server. and from that central... (9 Replies)
Discussion started by: SkySmart
9 Replies

3. Shell Programming and Scripting

Gathering data in columns from multiple files

Hello world! I need to gather all the data from different folders and copy it in an one unique text file in columns format. Let me explain, letīs say "a, b, c" are 3 data files of thousands and thousands lines (in the reality, I have nearly one hundred). "a, b, c" are located in the folders... (5 Replies)
Discussion started by: user10600
5 Replies

4. Red Hat

What is the best tools for performance data gathering and analysis?

Dear Guru, IHAC who complaint that his CentOS is getting performance issue. I have to help him out of there. Could you please tell me which tools is better to gathering the whole system performance data? -- CPU/Memory/IO(disk & Network)/swap I would like the tools could be... (6 Replies)
Discussion started by: devyfong
6 Replies

5. UNIX for Advanced & Expert Users

Gathering data using SAR

Hi everyone, I would like to ask if it is possible to gather SAR data on a specified time. let say yesterdays report, i want to get data at around 12PM and 5PM. thank you. (2 Replies)
Discussion started by: cwiggler
2 Replies

6. UNIX for Dummies Questions & Answers

Gathering data from complex/large dataspreads .txt format

Hi, I'm working on gathering information stored in .txt files. The format of the data within the .txt files is shown in the picture uploaded with this post. Sections like the one pictured are repeated (with different data, same format) many times within each .txt file but each section is of data... (4 Replies)
Discussion started by: p43hd
4 Replies

7. HP-UX

HP-UX configuration gathering tool

Hello! I would like to introduce a tool for gathering information on the HP- UX operating system. I would like to hear experts opinions about this utility, its prospects and usefulness. Any feedbacks, suggestions, bug reports, feature requests etc are welcome. The tool project web page:... (0 Replies)
Discussion started by: ahaidukov
0 Replies

8. UNIX for Dummies Questions & Answers

Gathering system configuration

Hi there, I have been asked to write a script that gathers enough information on our Sun Solaris machines to be able to rebuild and configure them if they should go pop. My question is does anybody have any suggestions on the files that I need to take a copy of, to ensure that everything is... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

9. Shell Programming and Scripting

Gathering info on one line

Hi all again, here is the file i am working on : GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:04 GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:06 GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:11 GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:18... (5 Replies)
Discussion started by: HowardIsHigh
5 Replies
Login or Register to Ask a Question