[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Rescheduling a job in cron daily
- From: Bob McClure Jr <robertmcclure earthlink net>
- To: redhat-install-list redhat com
- Subject: Re: Rescheduling a job in cron daily
- Date: Thu, 23 Oct 2003 08:26:35 -0500
On Thu, Oct 23, 2003 at 02:07:29PM +1000, Graeme Nichols wrote:
> On Thu, 2003-10-23 at 13:43, Bob McClure Jr wrote:
> > On Thu, Oct 23, 2003 at 01:21:59PM +1000, Graeme Nichols wrote:
> > > Dear Bob McClure and others,
> > >
> > > The following is the output of ps aux while some very heavy disk
> > > activity was going on (the long lines were shortened due to them
> > > exceeding the width of my virtual terminal). It appears that the culprit
> > > is updatedb, although I must admit to not really understanding what I am
> > > looking at.
> > >
> > > I would like to move the disk hog to cron weekly because the heavy disk
> > > activity is a pain in the rear end. Could you advise me how to do it
> > > please?
> > >
> > > output of ps aux follows:
> > >
> > > root 1622 0.0 0.3 1356 380 ? S 12:52 0:00
> > > /sbin/ppp-watch ppp0 ifcfg-ppp0
> > > root 1624 0.0 0.6 1836 856 ttyS0 S 12:52 0:00 pppd
> > > -detach lock modem crtscts asyncmap 00000000 defaroot 1706 0.0
> > > 0.8 3820 1080 ? SN 12:55 0:00 /bin/bash /usr/bin/run-parts
> > > /etc/cron.daily
> > > root 1996 0.0 0.7 3808 996 ? SN 12:56 0:00 /bin/sh
> > > /etc/cron.daily/slocate.cron
> > > root 1997 0.0 0.5 3584 720 ? SN 12:56 0:00 awk -v
> > > progname=/etc/cron.daily/slocate.cron progname
> > > root 1999 0.8 0.4 1472 572 ? DN 12:56 0:02
> > > /usr/bin/updatedb -f NFS,SMBFS,NCPFS,PROC,DEVPTS -e /t
> > >
> > > --
> > >
> > > Kind regards,
> > >
> > > Graeme Nichols
> >
> > updatedb is the process that builds a database of all (well, most) of
> > the filesystems on the machine. That database is used by "locate"
> > which is a kind of "find" on steroids. To find some file, say,
> > foobar, on the system, you can
> >
> > locate foo
> >
> > and it will list all pathnames containing "foo", perhaps including
> >
> > /home/bubba/food/menu.txt
> > /home/bubba/tools/foobar.pl
> > ... etc.
> >
> > Why is it running at 12:56? It is normally run out of
> > /etc/cron.daily/slocate.cron at 0402 or thereabouts based on the
> > contents of /etc/crontab.
> >
> > Yes, you can simply
> >
> > mv /etc/cron.daily/slocate.cron /etc/cron.weekly/
> >
> > but (1) your locate database will be up to six days old, and (2) I
> > think you have a much more important problem of either a screwed up
> > system clock or /etc/crontab.
> >
> > Fix the real problem first. Maybe the other problem won't be a
> > problem.
>
> Hello again Bob, I just did a crontab under both root and graeme logins
> and it came back with in bothe cases, 'No crontab for root' and 'No
> crontab for Graeme'. How can I check for a bad crontab? Sorry to be a
> pita.
Another poster identified what I missed. I was assuming that the
system was up full time, but you say it is not. As he said, if the
4am crontab run doesn't run (because the machine is off) it runs
shortly after being turned on and booted by virtue of a thing called
"anacron". It's just trying to make up for a missed schedule.
If you move the slocate.cron script to /etc/cron.weekly, and you boot
the machine daily, then the first time you boot it after 0420 Sunday
morning, it's going to run the /etc/cron.weekly scripts. As the other
poster suggested, it may be simpler to plan on going for coffee after
you boot, to allow the cron.daily scripts to run.
Root actually has two crontabs. It has what I would call the
stereotyped crontab at /etc/crontab. In addition, there is what one
might call root's "personal" crontab, which is for things that don't
fit the schedule of /etc/crontab. It is kept in the same area as your
(mere mortal) crontab. And, out of the box, root doesn't have (or
need) a crontab other than the one in /etc.
So disregard my erroneous conjecture about a bad crontab. I was
assuming you were keeping the machine up full time.
> --
>
> Kind regards,
>
> Graeme Nichols
Cheers,
--
Bob McClure, Jr. Bobcat Open Systems, Inc.
robertmcclure earthlink net http://www.bobcatos.com
Happiness is an inside job.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]