LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How can I run the "cu" command under cron? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-run-the-cu-command-under-cron-299097/)

tcore 03-08-2005 07:20 AM

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

trickykid 03-08-2005 07:45 AM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php


All times are GMT -5. The time now is 12:14 AM.