Thanks for your input.
With the serial device connected to the com port, and I run the command below
cu –l /dev/ttyS0 –s 2400 dir | tee log_out
I get the following in the log_out file, which is also what I see being displayed on my screen. Note that this is part of the data that I would like to capture or log automatically.
*** Reset reason: POWER ON ***
Performing Self-Tests:
Hardware version: PASS
External SRAM: PASS
External FLASH: PASS (Man= 0001, Dev= 22BA: AM29LV400B (4 MBit) )
Terminal IDs: PASS
Application Load: PASS
..............~..Connected.
Connected.
Disconnected.
-----------------------------------
I have since created the following script which I would like cron to run
#!/bin/sh
LOGDATE=`data +%y%m%d`
LOGFILE=/tmp/ttyS0.$LOGDATE
cu –s 2400 –l /dev/ttyS0 dir | tee $LOGFILE0
When I run the above script which I call capture_port, from the command line, a file is created and similar data as above is written to the file.
However when I run this script under cron (root or uucp user ) the only data I see in the log file is "connected" followed by "disconected"
The cron entry I have is
0,10,20,30,40,50 * * * * /etc/uucp/capture_port
Every time cron runs "capture_port" I receive this mail message from cron. I am concerned about the line. . cu:End of file on terminal
Date: Fri, 11 Mar 2005 07:30:00 -0500
From:
root@localhost.localdomain (Cron Daemon)
To:
root@localhost.localdomain
Subject: Cron <root@lager> /etc/uucp/capture_port
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
/bin/sh
cu: End of file on terminal
Connected.
Connected.
Disconnected.
-----------------------------
If I shorten the cu command in my script "cu -l /dev/ttyS0 -s 2400 dir" and modify the cron entry to be "/etc/uucp/cmd_capture 2> /tmp/log_out 1> /dev/null" then a file log_out is created and it contains only one line
cu: End of file on terminal
Any ideas on why I get this message. It seems that cu opens the ttyS0 port but it is expecting something to keep it open. What ever is required to keep the port open is not present so the port is closed
Tcore