Crontab

Hi all,

I am finding a issue with crontab that whatever the changes I made in the crontab file on the previous day wont be getting replicated today.

I saved the editor properly.

What would be the reason behind this.

For Eg: 03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh replaced to
00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh Yesterday

But now I am finding only the old one.

03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh

The replaced one get disappeared. What would be the reason behind this?

Please explain.

OS: SunSolaris 5.8

Thanks and Regards,
Prashanth

Is that file system mirrored? Perhaps there's a problem with that, check it ("metastat" if you're using solstice).
Regards.

I was not aware of this metastat.

While typing metastat it gave some details like follows (as this ):

d138: Concat/Stripe
Size: 93762560 blocks
Stripe 0:
Device Start Block Dbase
emcpower52a 0 No
Stripe 1:
Device Start Block Dbase
emcpower53a 0 No
.......................

You have to check the status for the /var filesystem. To do so, try to find which is the appropriate device. For instance:

df -k /var

and then

metastat <device>

where <device> is the solstice device name without /dev/...
Have a look at metastat man page for more information.
Regards.

Hope this is mirrored.

Following are the output once the command was issued.

$ df -k /var
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d5 10327372 501516 9722583 5% /var
$ metastat /dev/md/dsk/d5
d5: Mirror
Submirror 0: d15
State: Okay
Submirror 1: d25
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 20972736 blocks

d15: Submirror of d5
State: Okay
Size: 20972736 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c1t0d0s5 0 No Okay

d25: Submirror of d5
State: Okay
Size: 20972736 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c1t1d0s5 0 No Okay

Hi

I found that when ever I am closing my current session the changes which i made are getting freezed. By opening another new session I cant find any changes which i made in the crontab entry.

What would be the reason behind this?

Please explain.

Prashanth.g.s.

What do you mean by "getting freezed"?
And, how are you updating the crontab? vi? crontab -e?

Anyway, try to force a synchronization (metasync and/or sync commands) before you exit your session...

<<What do you mean by "getting freezed"?

The changes which i made are not there in the crontab.

<<And, how are you updating the crontab? vi? crontab -e?

using crontab -e

/,Anyway, try to force a synchronization (metasync and/or sync commands) before you exit your session...

Did I need to complete this by using root user or normal user?

Hi Prashanth!

The below question makes lot of sense.

Could you please be more clear on the below details.
--------------------------------------------------------------------
Which editor you are using i.e stored in $EDITOR/$VISUAL variables
How are you making the Changes to your crontab file
How are you saving the crontab file.[FONT=Courier New]
--------------------------------------------------------------------
Cheers
Kishor

Hi Kishore,

  1. I am using vi editor.

export EDITOR=vi (I am issuing this command to use vi when ever I am using crontab -e otherways it doesnt enter into vi prompt.

ie, it give result such as

$ crontab -e
137

$ export EDITOR=vi

$ crontab -e

03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh >> /tmp/export.log

  1. crontab -e

I ll be doing the changes over here as

00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log replacing 03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh >> /tmp/export.log

I will be saving as

ESC : wq

After that I was able to see the changes

crontab -l

00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log

But If I close the session and open the new session I was not able to find the changes I made.

It displays as

03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh >> /tmp/export.log

Where I was wrong from my side?
Please advice.

Prashanth

You have to bocome root.

Prashanth,

It really seems to be strange!!!!!!!!!!
It should work actually.I discussed with my friends also.

Can we do one thing.

Do u have .cshrc file in your home directory(if u r using C shell).
U can add this line(setenv EDITOR=vi or export EDITOR=vi) and see.

Actually what happens is

you are setting EDITOR variable in your present session.Its alive for that session only.If u specify that in ur .cshrc file every time u log in that will be set automatically.

Just a trial.......ok ..if not We'll try again ok.

Cheers
Kishor

Hi Kishore,

I am finding the following content in the local.cshrc file.

# @(#)cshrc 1.11 89/11/29 SMI
umask 022
set path=(/bin /usr/bin /usr/ucb /etc .)
if ( $?prompt ) then
set history=32
endif

Do you want me to add in the following manner:

# @(#)cshrc 1.11 89/11/29 SMI
umask 022
set path=(/bin /usr/bin /usr/ucb /etc .)
if ( $?prompt ) then
set history=32
endif
setenv EDITOR=vi

Thanks

Prashanth

Yep Prashanth....!!!!!

go on.....

Thanks
Kishor

No Kishore, there is no change after trying this.

Note:
Whenever I am closing the session after using the crontab -e. I am getting this message all the time

$ exit
You have stopped jobs

But If i doesnt use crontab -e I wont be getting any this type of message while closing the session.

Any point to concentrate on this ????

Could you please describe exactly everything you are doing, please?
I mean, steps, commands, user, shell, etc... from the begining, when you login, to the end, when you exit.

Hi grial,

Please go through the steps I have done.

login: oracle10
Password:

$ oraenv
ORACLE_SID = [gdbuat] ? gdbuat

$ crontab -l
03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh >> /tmp/export.log

$ crontab -e (AS THE VI EDITOR IS NOT OPENING WHILE ISSUING crontab -e I CLOSED USING CTRL+Z)
137
^Z[2] + Stopped (SIGTSTP) crontab -e

$ export EDITOR=vi
$

$crontab -e ----------Replacing the old one with new.
00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log

$ crontab -l
00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log

$ exit
You have stopped jobs

$ exit

OPENING NEW SESSION:

login: oracle10
Password:

$ oraenv
ORACLE_SID = [gdbuat] ? gdbuat

$ crontab -l
03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh >> /tmp/export.log

I cant see the changes What ever I made in crontab entry in the old session.

If any questions please revert back to me.

Regards,
Prashanth

Why did you give CTRL-Z? That does not end the "crontab -e" process. That's why the "Stopped (SIGTSTP) crontab -e" and "You have stopped jobs" messages are displayed.

First of all, check whether there is any crontab commad running:

ps -ef | grep oracle10 | grep crontab | grep -v grep
  • kill it/them.
  • Set the appropriate EDITOR value in your shell initialization file. Exit and login again.
  • "crontab -e"
  • make changes, save them and exit.
  • login and let's see...

Yep..Prashanth

Grial is perfect..!!!!!!!Thanks a lot grial.

We'll wait for the heads up!!!!!!!!!!!

Thanks
Kishor

SESSION 1:

$ ps -ef | grep oracle10 | grep crontab | grep -v grep

$kill -9 22754
$kill -9 22755
$kill -9 22747

(I killed all the crontab session )

$ps -ef | grep oracle10 | grep crontab | grep -v grep

$export EDITOR=vi

$crontab -e

00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log

$ crontab -l
00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log

OPENED NEW SESSION (SESSION 2), I HAVENT CLOSED (SESSION 1)

login: oracle10
Password:

$ oraenv
ORACLE_SID = [gdbuat] ? gdbuat

$ crontab -l
00 00 * * 6 /gdbuat4/backupscripts/weeklyexp10g.sh >> /tmp/export.log

NOW CLOSED THE SESSION 1

$ exit
You have stopped jobs

$ exit

NOW IN SESSION 2

$ crontab -l
03 12 * * * /gdbuat4/backupscripts/dailyexp10g.sh >> /tmp/export.log
35 15 * * * /gdbuat4/backupscripts/sample.sh >> /tmp/export1.log

Conclusion:

If I close the session 1 where I have made changes in the crontab entry, the changes get removed while validating in Session 2. If not closed
Session 2 shows the updated entry.

Its really strange.

Hope you got the point.

Please explain.