Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cronjob can not start

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi

After my Solaris box, v 8, panics and restarts by itself, all my cron jobs set up in the cron file is gone, I have to recreate the file but this time, the cron file is there, but it seems the jobs are not started as scheduled. Does anyone know why and how can I check and fix it?

Thanks.
babeo
 
Regarding cron jobs not running: Is your cron daemon running? Do a ps -ef | grep cron. You should see a process for /usr/sbin/cron. If you don't you need to start the daemon.

also, did you recreate the file that isn't working? If you did, did you use crontab -e? If you did not use crontab -e, you are going to have to stop and restart the cron daemon.
 
Babeo,

Perhaps you should try to understand why your system panics? There may well be a link to when the system goes down and loosing the crontab file. I am supposing here that you are loosing the crontab file when the system comes back up. Try timing the interval and making a note of the time of day the system goes down. You may find a link with the crontab schedules and the time the system is crashing. If it is not this then at least you have eliminated it!

Good Luck!

Jimbo
 
Thank you all

Jimbo, I really like to know what's wrong with my box why it's panic and went down, but this is the 5th times within 1 year that it went down and reboots itself that so far nobody doesn't know what's the cause !!, well one time it causes by java process and causes the fault in page memory. Also, my experience is this box original has problem with java, so I guess most of the time it went down due to java ps (?!), but I am unable to catch where the exact error message, only able to see the message of the booting state, what time it reboots in the /var/log/messages file. By the way, my cron job is running at 10pm and the system crashes is around 5am of next day, so I can eliminate this cause as you said !

Bi, You are so right, the cron file is not original created by crontab -e, I believe due to the set up of vi (?) that I am unable to see all the lines in the cron file, but only 1 line at a time, which causes more difficult for me to edite the file. As the result, I decide to cat a text file into the cron file, but I have questions:
1) I have a mirror disk on another box (a), and this box is stable, however the same cron file (because mirror) does not work anymore after the other box (b) crashes? And strangerly, when the machine (b) went down , all the contain of the cron file is gone, but it does not affect on machine (a), I still see the cron file. It seems the cron file is not mirrored on both machines?

2) How come it works at the first implementation of this cron file? and it still works plus my cron files is still there (at 3 time out of 5 times when the system went down), but this time when my system went down and it trashes the cron file too? and another question about crontab -e. What can I do to be able edit the cron file in vi editor?

my default shell is ksh, but I have tried in csh, sh, even with different user including root, still giving me the same result of displaying the last empty available line in the cron file, which means it looks like not allow me to edite the file, but just add/append new things into this file. I am not sure this is the behavior/set up of the Solaris V8 or we can change it? With other solaris 2.6, I am able to open the cron file using crontab -e . It opens in vi and I am able to see all lines in that file, and I able to edit any line or add new command lines into this line at any where.

Thanks
 
You may need to set EDITOR to get crontab -e to work :
export EDITOR=vi
Hope it helps,
Mike
 
Hi Mike

EDITOR=vi is already set up, I forget to mention this in the previous post.
Tx
 
Hi Mike

I appologize for the previous post. I think I still feel sleeping this morning. Need a strong coffee today.

I check and working on another box that has the set up, but the box having problem is not set up yet. I just don't know why I did not catch this point. !!!

sorry again, and thanks to point it out for me.
 
babeo,

Regarding not being able to see more than one line at a time with vi: try exporting your TERM to be vt100 (export TERM=vt100 with ksh). I have this problem when I telnet from a DOS box on windows to a Unix system.

When you use crontab -e, you will be able to edit it just as if you would have opened it with vi.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top