How can I run the "cu" command under cron?
I have an application where I need to capture (log) data from a serial device connected to the com port of my computer (ttyS0) when I use the shell script (see below), I get connected, a file is created and data is captured.
#!/bin/sh
LOGDATE=`data +%y%m%d`
LOGFILE=/tmp/ttyS0.$LOGDATE
cu –s 2400 –l /dev/ttyS0 dir | tee $LOGFILE0
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 * * * * /tmp/captue_port
The script file "capture_port" does runs every 10 min. but each time only connected and disconnected is displayed.
Is there something that I am missing? Would anyone know how to keep the port open to capture this data using the cu command in the shell script?
Tcore
Last edited by tcore; 03-08-2005 at 07:14 AM.
|