473,379 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Help with a bash ftp script

alpnz
113 100+
I keep getting an error on the windows login of the following script. Any ideas anyone?

Expand|Select|Wrap|Line Numbers
  1. #!/bin/sh
  2. #A script to move files across a network, which has strict firewalling, and only one gateway computer.
  3. #No issues with PASV other than it does not function well through the firewall.
  4.  
  5. #Define the server to get the files from, and the files I want (It is a Windows ftp server, that I can connect too.)
  6.  
  7. HOST="192.168.195.195"
  8. USER="user1"
  9. PASS="alibaba1"
  10. FILE11=clientraw.txt
  11. FILE22=clientrawdaily.txt
  12. FILE33=clientrawextra.txt
  13.  
  14.  
  15. #Define the server I want to put the files into.
  16.  
  17. HOST1="ftp.somewhere.on.the.net"
  18. USER1="user2"
  19. PASSWD1="alibaba2"
  20. FILE1=/scripts/wxdata/clientraw.txt
  21. FILE2=/scripts/wxdata/clientrawdaily.txt
  22. FILE3=/scripts/wxdata/clientrawextra.txt
  23.  
  24. #Go get the files from the windows box too the Linux gateway server. (Stalls at the password stage on the windows server.)
  25.  
  26. ftp -n $HOST PASV<<END_SCRIPT
  27. quote USER $USER
  28. quote PASS $PASS
  29. get $FILE11    /scripts/wxdata/clientraw.txt
  30. get $FILE22    /scripts/wxdata/clientrawdaily.txt
  31. get $FILE33    /scripts/wxdata/clientrawextra.txt
  32. quit
  33. END_SCRIPT
  34.  
  35. #Put the files where I want. (This part works fine)
  36.  
  37. ftp -n $HOST1 <<END_SCRIPT
  38. quote USER $USER1
  39. quote PASS $PASSWD1
  40. put $FILE1 /htdocs/wx/clientraw.txt
  41. put $FILE2 /htdocs/wx/clientrawdaily.txt
  42. put $FILE3 /htdocs/wx/clientrawextra.txt
  43. quit
  44. END_SCRIPT
  45. exit 0
  46.  
  47.  
Any help appreciated.
Feb 25 '08 #1
0 3795

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bernhard Kuemel | last post by:
Hi! To relief the problems of accessing a unix machine from behind a restrictive firewall or from an internet cafe I started to make a PHP web interface to bash. I'd like to hear your opinions...
4
by: David Bruno | last post by:
I set up a crontab using cpanel8 for the first time. It's just to run a very simple php script that sends an email and has one include() function. The first try at the crontab produced a...
4
by: Tom Purl | last post by:
I just wrote a Python script that is going to be called from bash script. If the Python script fails, I want the bash script to also stop running. Unfortunately, I can't seem to get that to work. ...
0
by: Pekka Niiranen | last post by:
Hi there I have installed Cygwin to my w2k machine and use Python to execute Bash -shell scripts. I noticed that in script below parameter "shell=False" causes raw_input() to fail; the only way...
11
by: Magnus Jonneryd | last post by:
Hi, I'm planning on writing a program that interactively is fed input via a shell (bash). I also want to be able to write a shell script that executes various commands related to my program. In...
22
by: sri | last post by:
Hi I am new to C language. Still I am using Turbo C++ 3 Compiler. Any New version is available for Windows XP platforms. Borland releases C++ 5.5 Command line tools. Is There any New C Compiler...
6
by: Ishpeck | last post by:
I'm using Python to automate testing software for my company. I wanted the computers in my testing lab to automatically fetch the latest version of the python scripts from a CVS repository and...
1
by: pnjbi | last post by:
Hi, I've created a bash script which is executed every 5 minutes through a cron. The script checks if a trigger variable has been set to execute certain commands. If it is the commands are...
4
by: melmack3 | last post by:
Hello My PHP script executes many bash/cmd commands. Functions like "exec()" or "system()" cause that new bash/cmd session is started, the command is executed and the session is closed....
3
by: uzzi | last post by:
I don't know how to make a php script to work via cron...I want to make it run daily...My server API is CGI/Fast CGI.I have hosting from godaddy and in the help section i found that i have to specify...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.