1845900 Members
4182 Online
110250 Solutions
New Discussion

Re: CronTab

 
Dan Decker
Frequent Advisor

CronTab

I have a minor issue with my Class D 9000 system everytime we reboot this box, which isn't often I might add, I have to re-enter my backup entry that runs my backup script. Anybody know why this is? I don't have this problem with my 800 series.

Thanks for your thoughts.

DKD
It's not done Till I am satisfied
11 REPLIES 11
Tim Malnati
Honored Contributor

Re: CronTab

A D class box is an 800 series machine. Maybe some different drivers to satisy hardware, but it runs all the same stuff as any other 800 series machine.

What is happening here is very unusual though. I would look carefully at the boot logs to see if maybe someone at some time has added something different to somehow 'protect' cron. I would also look carefully at init.d scripts (crond in particular) to see if something is there.
Patrick Wallek
Honored Contributor

Re: CronTab

Is the backup script the only entry in your crontab file? Is the file /var/spool/cron/crontabs/root getting removed?

Here is something you can do so you don't have to manually enter your script every time.

1) Make a backup copy of your root crontab file and call it something like root.crontab. You can save it anywhere you want. root's home directory would be a good place. Just remember to update this file whenever you make a change to root's crontab file.

2) When you have to redo your backup entry you can do 'crontab /root.crontab', as the root user of course, and then it will read the contents of /root.crontab into root's real crontab file.

I know this doesn't help you solve your real problem though. I would look at the system init scripts and see if someone is doing something like removing the root crontab file for some strange reason. The system itself shouldn't be doing anything to it.
Paula J Frazer-Campbell
Honored Contributor

Re: CronTab

Hi Dan

Is your /var dir at 100% as this can cause a disappearing crontab.

Paula
If you can spell SysAdmin then you is one - anon
Dan Decker
Frequent Advisor

Re: CronTab

Thanks for the replies.

What I have are 2 older 9000 boxes a 800/H60 and a 800/H60 inaddition to my newest Class D 9000 I haven't had to do anything to crontab after rebooting the two older models. I guess older is better. AH AH never mind.

Somebody had told me earlier about making sure my entry was in a startup script. so when the systtem reboots it gets loaded back in. I haven't had time to look into that. My Crontab has all kinds of entries and none of those get removed just my backup entry. This doesn't make sense to me
My Var diectory isn't full
Any other suggestion would be helpful thanks

DKD
It's not done Till I am satisfied
Steven Sim Kok Leong
Honored Contributor

Re: CronTab

Hi,

to aid troubleshooting, check your /etc/rc.log and see if any errors occur during your system startup.

Check also your /var/adm/syslog/syslog.log for errors from cron.

Most importantly, check your cron LOG in /var/adm/cron and observe when your scheduled job disappears.

Hope this helps. Regards.

Steven Sim
Brainbench MVP for Unix Admin
http://www.brainbench.com
Steven Sim Kok Leong
Honored Contributor

Re: CronTab

Hi,

Is this problem specific to only one user? Check also the last modified timestamp for your user's crontab to identify when the cron job was actually changed. Subsequently, find out what the system conditions were at the time of change from logs?

Hope this helps. Regards.

Steven Sim
Brainbench MVP for Unix Admin
http://www.brainbench.com
Sandor Horvath_2
Valued Contributor

Re: CronTab

Hi !

It seems to be Your crontab was modified. Check /var/spool/cron/crontabs/username file modification date.
Our have az application under ServiceGuard which rewrite the crontabs when package start.

If You want to found what happend write a script, named crontab which logging the date and the processes, after call right crontab. Do it in the first path in $PATH environment.

Do not forget Your crontab can modify root and owner .

regards, Saa
If no problem, don't fixed it.
Dan Decker
Frequent Advisor

Re: CronTab

Thanks for all the responses. I did check the log files specified and didn't see any error messages other than we didn't restart the Oracle application database all others looked like the trim schedule kicked in. The reboot happened on Friday around noon and I didn't discover the problem till Saturday evening when I came in to work to change out the backup tape.

The user in question is Root and I did see a new crontab file under the user Root created with the backup reentered.

I inherited this system so I am still finding things that don't look right and it is going to take some time to try and get it into the right order if that is possible.

For some reason I was not able to assign any points to your replies hope I can in the future. Thanks DKD
It's not done Till I am satisfied
Dan Decker
Frequent Advisor

Re: CronTab

Hi again

Apparently you have to reply to the responses before you can assign any point as I just found out. Oh well if we didn't learn something new in this job is sure could get boring.

Thanks all
It's not done Till I am satisfied
Patrick Wallek
Honored Contributor

Re: CronTab

You don't have to replay to a message to assign points, you just have to be logged into the ITRC.
When you reply to a message it automagically attempts to log you in. When you are logged in, you see a message like "Welcome, Dan Decker" at the bottom of the "IT resource center" menu on the left side of the screen. If you are not logged in you will see a message saying something like "Please Log In" in that same spot. There is a 'login' option on the menu on that same menu.

Sandor Horvath_2
Valued Contributor

Re: CronTab

Hi !

The crontab can modified by crontab command ( or edited the crontab file, but never do that ) so if You have time and resource do that:

1, find all script in Your system :

# find / -exec file {} \; | grep command > /tmp/scripts

# grep crontab `cat /tmp/scripts`

May be You will find script which modified Your crontab.

regards, Saa
If no problem, don't fixed it.