Bug 19286 - cron sends error message about nonexistent files
Summary: cron sends error message about nonexistent files
Keywords:
Status: CLOSED DUPLICATE of bug 19129
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sysstat
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Preston Brown
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-17 21:10 UTC by mw
Modified: 2007-04-18 16:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-10-25 05:16:10 UTC
Embargoed:


Attachments (Terms of Use)

Description mw 2000-10-17 21:10:39 UTC
I get these misterious messages sent by cron to root:

---------------------------------------------
Date: 17 Oct 2000 00:05:01 -0000
From: root.memphis.edu (Cron Daemon)
To: root.memphis.edu
Subject: Cron <root@moni> /usr/lib/sa/sa2 -A &

Cannot open /var/log/sa/sa16: No such file or directory
-------------------------------------------
Presently, I have

$ ls -l /var/log/sa/*
-rw-r--r--    1 root     root       101305 Oct 15 23:49 /var/log/sa/sa15
-rw-r--r--    1 root     root        98977 Oct 15 19:05 /var/log/sa/sar15
-rw-r--r--    1 root     root            0 Oct 16 19:05 /var/log/sa/sar16

I do have the updated version of sysstat:

# rpm -q sysstat
sysstat-3.2.4-5

Does this have anything to do with the incorrect crontab entry:

0 * * * 0,6 root /usr/lib/sa/sa1 600 6 &

Thx

Mate

Comment 1 Daniel L. Rall 2000-10-25 04:53:03 UTC
mw.memphis.edu is right.  I have the updated version of systat:

root@despot:sa$ rpm -qf /usr/lib/sa/sa2
sysstat-3.2.4-5

I've got the same damn problem:

-----------
Subject: 
         Cron <root@despot> /usr/lib/sa/sa2 -A &
    Date: 
         Tue, 24 Oct 2000 19:05:00 -0700
   From: 
         root.com (Cron Daemon)
      To: 
         root.com




Cannot open /var/log/sa/sa24: No such file or directory
-----------

Here's my patch to make the /usr/lib/sa/sa2 script not try to read records from
a file that doesn't exist:

root@despot:sa$ diff -u sa2-ORIG sa2
--- sa2-ORIG	Tue Oct 24 21:28:45 2000
+++ sa2	Tue Oct 24 21:28:04 2000
@@ -8,5 +8,7 @@
 ENDIR=/usr/bin
 DFILE=/var/log/sa/sa${DATE}
 cd ${ENDIR}
-${ENDIR}/sar $* -f ${DFILE} > ${RPT}
+if [ -f ${DFILE} ] ; then
+    ${ENDIR}/sar $* -f ${DFILE} > ${RPT}
+fi
 find /var/log/sa \( -name 'sar*' -o -name 'sa*' \) -mtime +7 -exec rm -f {} \;

I don't know if this is the Right Thing, since I don't really know what the sar
binary does, but it makes it so I don't get emailed an error message every
night, and I like that.  ;P

-- Daniel Rall


Comment 2 Daniel L. Rall 2000-10-25 05:16:08 UTC
The /etc/crontab entries for both the sa{1,2} scripts look just fine.  However,
for some reason, I don't always have system activity data logged to /var/sa for
sar to generate the reports from:

root@despot:sa$ la /var/log/sa
total 660
drwxr-xr-x    2 root     root         4096 Oct 24 19:05 ./
drwxr-xr-x    7 root     root         4096 Oct 22 04:02 ../
-rw-r--r--    1 root     root       155737 Oct 21 23:50 sa21
-rw-r--r--    1 root     root       153577 Oct 22 23:50 sa22
-rw-r--r--    1 root     root            0 Oct 19 19:05 sar19
-rw-r--r--    1 root     root            0 Oct 20 19:05 sar20
-rw-r--r--    1 root     root       167911 Oct 21 19:05 sar21
-rw-r--r--    1 root     root       164853 Oct 22 19:05 sar22
-rw-r--r--    1 root     root            0 Oct 23 19:05 sar23
-rw-r--r--    1 root     root            0 Oct 24 21:22 sar24

The /usr/lib/sa/sa1 script should be logging this data to the saDD files through
its invokation of sadc.

- Daniel


Comment 3 Preston Brown 2001-01-05 20:40:20 UTC

*** This bug has been marked as a duplicate of 19129 ***


Note You need to log in before you can comment on or make changes to this bug.