Operating System - HP-UX
1829576 Members
3080 Online
109992 Solutions
New Discussion

crontab changes ineffective

 
SOLVED
Go to solution
Tom Elder
Advisor

crontab changes ineffective

in a crontab for a user called oper
changes are made and retained in the crontab by using crontab -e command but yet the change of time of execution does not occur and the command executes at the old time.
anybody seen this before ?
better yet is there a fix ?
6 REPLIES 6
Rick Garland
Honored Contributor

Re: crontab changes ineffective

There are some Cumulative patches available for cron. PHCO_21494 for s800 11.00
and PHCO_19985 for s800 10.20

Have you tried stopping and then restarting the cron process after modification? I know you don't need to do this after the crontab -e, but it could be a starting point to troubleshooting
Kofi ARTHIABAH
Honored Contributor
Solution

Re: crontab changes ineffective

Tom: it is possible that the new crontab was not saved (ie with :wq!) you can check on the existing (active crontab) with
# cat /var/spool/cron/crontabs/oper
if that file contains the old time, then you would have to re-edit (with crontab -e) and make sure to save.

You could also vi the /var/spool/cron/crontabs/oper with your modifications and then while logged in as oper, run:

crontab /var/spool/cron/crontabs/oper

you can check the cron logs at: /var/adm/cron/log

nothing wrong with me that a few lines of code cannot fix!
D. Jackson_1
Honored Contributor

Re: crontab changes ineffective

Do you have a copy of what you are trying to do.. the crontab file???
Rita C Workman
Honored Contributor

Re: crontab changes ineffective

I have a habit of always doing a crontab on my file after I make changes
.....just to be on the safe side.

Just a thought,
Tom Elder
Advisor

Re: crontab changes ineffective

thanks for your input I checked with the what
the SA is doing and found that he is going to /var/spool/cron/crontabs/oper and using vi and saving it and double checking his work as root but what he was not doing whas changing the permissions from r--------- to writable
so sorry for the trouble I should have done a little bit more research.

Mark Mitchell
Trusted Contributor

Re: crontab changes ineffective

You have to initialize the cron file, if its root's file then make sure that you are logged in as root. Here is a quick way that I do it.
crontab -l |vi filename
crontab filename
The second command will kick off the changes.