Weird crontab problem

Greetings To All!

I am running Solaris 10 in a sparc environment.

Here is the deal:

In /var/spool/cron/crontabs, there is a cron user named "sys". If I do a
crontab -l sys, it returns:

# 0 * * * 0-6 /usr/lib/sa/sa1
# 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
# 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

I have tried to modify the above job by changing the first line...and uncommenting all 3 lines, so that it will read the following at run time:

0,5,10,15,20,25,30,35,40,45,50,55 * * * 0-6 /usr/lib/sa/sa1
20,40 8-17 * * 1-5 /usr/lib/sa/sa1
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

I am making the above mentioned modification as user "sys", who owns this particular cron job.

The problem is this:

For some weird, unexplainable reason, the modified cron job:

0,5,10,15,20,25,30,35,40,45,50,55 * * * 0-6 /usr/lib/sa/sa1
20,40 8-17 * * 1-5 /usr/lib/sa/sa1
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

will always revert back to its original default to read:

# 0 * * * 0-6 /usr/lib/sa/sa1
# 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
# 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

Anyone have any ideas what could be causing this? This one has me scratching my head...

Your replies are greatly appreciated!

Sincerely

RobSand

How are you changing it?

Are you using the "crontab" tool to update the table?

When does it revert? Looking at the Solaris 10 source code, I notice this: Cross Reference: /onnv/onnv-gate/usr/src/cmd/sa/svc-sar

I am using: crontab -e sys

I do not know what time it reverted; I looked in the cron log and could not find anything in there.

Rob

If the file was changed, so was the timestamp on the file. But I wasn't looking for simply a timestamp. I mean, for example, does it change on reboot? Does it change once a day? Are you stopping and restarting the service, and if so does that change it? Etc.

Have you tried su'ing to the sys user and doing a bit of crontab -e as that user directly?

Which editor you use to modify cronjob ?
If you use edit , sometime it works weird as if wrote to file but it doesn't.
I recommend that;

EDITOR=vi
export EDITOR
crontab -e

go with vi...and modify and save...

To Everyone Who Answered This Thread,

This ended up being the solution:

Instead of editing the crontab file /var/spool/cron/crontabs/sys using the command crontab -e sys, the problem was fixed when I edited the file directly using vi as user root. I know this sounds illogical, especially considering the fact that crontab -e sys is the "clean" way to do a crontab file edit, but hey...that's what works!

Also, I wanted to thank each and everyone of you for giving me some of your valuable time by posting to this thread. One of the things that I have found to be true in these forums is that, oftentimes, there is no single posting that adequately answers a problem/question. But rather, it is the collective accumulation of a bunch of good, close answers that most often leads to a workable solution.

Thanks again guys (and ladies). Ya'll are the best and it is through your unselfish efforts is what makes the forums a success!

Rob Sandifer