how to tell if a cron job is still active...

From: George Gallen (ggallen@slackinc.com)
Date: Tue May 07 2002 - 15:07:53 EDT


I have a cron job that is run as root at noon time that basically backs up
our data to a local drive using:

(cd /data2 ; tar cvf - .) | (cd /drive1/data2 ; tar xfp -)
and so on for a number of different filesystems

Now hours after this "should" have been done, if I run a ps, grepping for
tar:

# ps -ef | grep tar
root 32495 32539 0.0 12:00:00 ?? 0:13.49 tar cvf - .
root 32539 32524 0.0 12:00:00 ?? 0:33.87 tar xfp -

I checked my mail for root and there are no messages from cron of any
problems.

Why arn't these processes dead? Is there anyway to tell if they are
still doing anything? Maybe there is a locked file somewhere it's waiting
on??
As well, is there anyway to know which directory it's on at this time
since I run multiple tars one after the other (not concurrently), maybe I
can check that particular FS.

Each day cron fires off the backup, and leaves the above. We will get
two more tomorrow (we rebooted yesterday, so only 2 today), and so on
eating away at available processes.

Now one theory I have, is that the directory where the data is being copied
to is close on running out of space, however, the reserve % is enough to
cover the difference. I can manually copy a file there with no error msgs.
Could the low overhead of available disk space being hanging these
processes?

And a second piece I noticed, not sure what the problem is here, on reboot
after a gracefull shutdown using the shutdown script, it needed to fsck the
filesystem that /tmp is on?? It found some superblock discrepancies. However
it didn't report any unsalvagable data, as well /lost+found is empty. I
havn't
manually fscked that FS today, but thought it was strange to have a FS
getting
fsck'd even after a gracefull shutdown

If I grep for the parent i get:

root 32524 1 0.0 12:00:00 ?? 0:00.01 sh -c
/usr/local/copyit &

which is my cron entry.

Q. does cron normally add in the "sh -c " part? In man of csh, there is
   a -c switch which makes sense for cron to use it.

This is on an older OS, 3.2c on a 2100, but I think these Q's should be
applicable to T64 in general.

George Gallen
Senior Programmer/Analyst
Accounting/Data Division
ggallen@slackinc.com
ph:856.848.1000 Ext 220

SLACK Incorporated - An innovative information, education and management
company
http://www.slackinc.com



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:40 EDT