What am I doing wrong here?

What am I doing wrong here?

Post by esal.. » Mon, 03 May 1999 04:00:00



I am trying to get the following shell script to run from a cron job but
the script doesn't seem to get past line 4. Can anyone help?

1. #!/bin/sh
2. # Line numbers are only for reference and are not included in the
actual code!
3.
#=======================================================================
4. ftp -n ftp.something.net
5. user myusrname mypassword
6. get /outgoing/*.* /etc/incoming/
7. bye
8. exit

 
 
 

What am I doing wrong here?

Post by Paul E. Ratt » Mon, 03 May 1999 04:00:00


It might help to indicate what the actual error is or to be more specific
about what you mean by "doesn't seem to get past line 4". Are you seeing an
error message for example?

Paul


>I am trying to get the following shell script to run from a cron job but
>the script doesn't seem to get past line 4. Can anyone help?

>1. #!/bin/sh
>2. # Line numbers are only for reference and are not included in the
>actual code!
>3.
>#=======================================================================
>4. ftp -n ftp.something.net
>5. user myusrname mypassword
>6. get /outgoing/*.* /etc/incoming/
>7. bye
>8. exit


 
 
 

What am I doing wrong here?

Post by Jeremy Sherrif » Tue, 04 May 1999 04:00:00


You need(?) to put ftp into non-interactive mode, and tell it where it
should stop listening to your script...

4. ftp -ni ftp.something.net << EOF
5. user myusrname mypassword
6. get /outgoing/*.* /etc/incoming/
7. bye
8. EOF
9. exit

That tells it to take commands from the script instead of your keyboard
until it hits the marker "EOF".

--
Jeremy Sherriff
Technical Admin

Remove "no-spam" from my e-mail address to reply.


>I am trying to get the following shell script to run from a cron job but
>the script doesn't seem to get past line 4. Can anyone help?

>1. #!/bin/sh
>2. # Line numbers are only for reference and are not included in the
>actual code!
>3.
>#=======================================================================
>4. ftp -n ftp.something.net
>5. user myusrname mypassword
>6. get /outgoing/*.* /etc/incoming/
>7. bye
>8. exit

 
 
 

What am I doing wrong here?

Post by Kurt J. Lanz » Tue, 04 May 1999 04:00:00



> I am trying to get the following shell script to run from a cron job but
> the script doesn't seem to get past line 4. Can anyone help?

> 1. #!/bin/sh
> 2. # Line numbers are only for reference and are not included in the
> actual code!
> 3.
> #=======================================================================
> 4. ftp -n ftp.something.net
> 5. user myusrname mypassword
> 6. get /outgoing/*.* /etc/incoming/
> 7. bye
> 8. exit

You obviously want lines 5-8 to be read as input by the ftp program on
line 4, but shells don't work that way. RTFM on the Bourne shell, paying
particular attention to input redirection, "here documents", etc....
You want something on the order of:

        echo "user....." | ftp .......

 
 
 

1. Dual Homed Linux - what am I doing wrong?

I have a RH 5.0 Linux PC setup with two Ethernet interfaces configured and
connected to two different LANs. Each LAN has a way out to the Internet, and
I've disabled IP forwarding on Linux to prevent the PC from routing between
the two LANs (which is my intention). The routing table entries for the first
LAN (eth0) simply has the usual loopback and LAN entries, and a default route
pointing to the gateway to the Internet. This works just fine.

On the eth1 interface, I have set up the Cisco router on the second LAN to use
RIP to broadcast routes on the second LAN. I then configure Linux to run
routed with -q (listen only) so that it can pick up the RIP routes and know to
use the second interface for routes to networks serviced by the Cisco. This
isn't working.

When I start routed -q, I end up with a route to the serial side of the Cisco
(that's good) and a second default route pointing to the Cisco on eth1 is
created (not good). With two default routes, Linux seems to pick the first
available default route when it doesn't know where to go - hence, all my
traffic continues out the eth0 interface when a better path is available on
eth1.

The route table never fills with routes known by the Cisco, so my question is
what am I doing wrong? Is this a known problem with Linux? Why is it creating
a second (and useless) default route instead of filling up with routes learned
via RIP?

Dan Peterka

2. Redirect port scanning with ipchains?

3. Am I doing something wrong?? - (SAMBA)

4. Remote log server

5. One more question - What am I doing wrong?

6. ANN: Embedded Systems Club / Ada UK conference & exhibition

7. KNode (No Caching) - What am I doing no wrong

8. Seeing Windows ME drive

9. gethostbyname misbehavior - what am i doing wrong.

10. What am I doing wrong?????

11. Ip-Masquerade and games over the net...what am I doing wrong????????

12. What I am doing wrong?

13. sendmail config -- what am I doing wrong?