473,473 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help with a bash ftp script

alpnz
113 New Member
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 3797

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: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.