Operating System - Linux
1833004 Members
3005 Online
110048 Solutions
New Discussion

Re: Prolbem downloading file with kermit and zmodem

 
Mika_13
Occasional Advisor

Prolbem downloading file with kermit and zmodem

Hi,

ok, what i want to do seems quite simple: dial into a Mailbox, send username und password, wait for a file to be transfered with zmodem-protokoll, logoff.

My first approach to do this job is the following kermit-script:

define LINE /dev/cul1p2
define PHONENUMBER 0123456789
define SPEED 19200
define MODEM microlink


define usage exit 1 {
Usage: do_download userid password
}

; check commandline
if not def \%1 usage
if not def \%2 usage

; here we go...
set line \m(LINE)
if fail exit 1
set speed \m(SPEED)
if fail exit 1
set modem \m(MODEM)
if fail exit 1
set escape-character ^C
set dial ignore-dialtone on
; dial in
dial \m(PHONENUMBER)
if fail exit 1
; send username
output \%1\13
; send password
output \%2\13
connect
; wait for mailbox to start zmodem-filetransfer. Mailbox will hangup after that.
exit 0

The problem is, that this script works fine, if i start it from a shell by hand.
But if i put it into my crontab-file, nothing happens after the dial-in. no filetransfer, nothing. After a timeout, the connection get's closed and that's all.
Any indeas? Maybe kermit is the problem and i should use a different way.

The system is a rp3440 with HP-UX 11.11

Regards
Dirk Mika
11 REPLIES 11
Muthukumar_5
Honored Contributor

Re: Prolbem downloading file with kermit and zmodem

Try to get debug informations of the file execution in crontab and as well as get cron log information to the execution of this script.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Prolbem downloading file with kermit and zmodem

Hello,

Check /var/adm/cron/log for more information.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Mika_13
Occasional Advisor

Re: Prolbem downloading file with kermit and zmodem

The cronlog says nothing special. The script is executed as expected.
it is working rigth upto the dialin. The only difference between starting it from a shell and beeing started by cron is that the filetransfer is not started.

Regards
Dirk Mika
Arunvijai_4
Honored Contributor

Re: Prolbem downloading file with kermit and zmodem

It could be due to shell variables. have you exported variables anytime ?

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Mika_13
Occasional Advisor

Re: Prolbem downloading file with kermit and zmodem

Hmm, shell variables can be a reason. of course there are lots of variables exportet, when starting the script in a shell.

and the environment of the cron-deamon is quit "small".

i will check if there is any variable, which could have an influence.

Regards.
Jean-Yves Picard
Trusted Contributor

Re: Prolbem downloading file with kermit and zmodem

Hello,

you didn't mention the exact command you enter via crontab.
I mean, did you set the -B (batch option) ?

Jean-Yves
Mika_13
Occasional Advisor

Re: Prolbem downloading file with kermit and zmodem

no i do not use the -B option. As far as i know it is only to force background (batch) operation when kermit is not able to detect it by itself.

it will give it a try.

Regards.
Mika_13
Occasional Advisor

Re: Prolbem downloading file with kermit and zmodem

just did a test with the -B option but with no effect.

it didn't make a difference.
Darren Prior
Honored Contributor

Re: Prolbem downloading file with kermit and zmodem

Hi Dirk,

I wonder if there's a problem reading the commandline? Try hardcoding the username and password as a temporary test, and removing the commandline handling code.

regards,

Darren.
Calm down. It's only ones and zeros...
Mika_13
Occasional Advisor

Re: Prolbem downloading file with kermit and zmodem

Hi,

i tried it with user and pass harcoded but with no success. Same result.

This ist the output i get, starting it by hand:
Trying: 0123456789...
Device: /dev/cul1p2, modem: microlink, speed: 19200
Dial timeout: 70 seconds
To cancel: type your interrupt character (normally Ctrl-C).
Call complete: "CONNECT 33600/LAPM/V42BIS".
Connecting to /dev/cul1p2, speed 19200.
The escape character is Ctrl-\ (ASCII 28, FS)
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------

**B0
----------------------------------------------------
Receiving: NOLDT.BEF
Bytes received: 130/ 130 BPS:244

Transfer complete
----------------------------------------------------
sz 3.45 03-28-97 finished.
+++
Closing /dev/cul1p2...OK

And this is what i get from the cronjob:
Connecting to /dev/cul1p2, speed 19200.
The escape character is Ctrl-\ (ASCII 28, FS)
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
(Back at byzmy6)
----------------------------------------------------
Closing /dev/cul1p2...OK


*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

Regards
Dirk Mika
Mika_13
Occasional Advisor

Re: Prolbem downloading file with kermit and zmodem

Hi again,

finally i found a solution, although i do not actually know the real cause.

This ist the script, which works for me:

define LINE /dev/cul1p2
define PHONENUMBER 0123456789
define SPEED 19200
define MODEM microlink

define usage exit 1 {
Usage: do_download userid password
}

; check commandline
if not def \%1 usage
if not def \%2 usage

; here we go...
set line \m(LINE)
if fail exit 1
set speed \m(SPEED)
if fail exit 1
set modem \m(MODEM)
if fail exit 1
set escape-character ^C
set dial ignore-dialtone on
; dial in
dial \m(PHONENUMBER)
if fail exit 1
; send username
output \%1\13
; send password
output \%2\13
; start rz to receive file with z-modem
redirect rz
; close connection
close
exit 0