Visit Our UNIX and Linux User Community


crontab problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers crontab problem
# 8  
Old 11-08-2001
Hi all,

Here is the oracle user shadow line in /etc/shadow
<pre>

<B>oracle:Lic8CakzDxM3o:11529:0:28:24::: <B>

username The user's login name (UID).

password A 13-character encrypted password for the user, a
lock string to indicate that the login is not
accessible, or no string, which shows that there
is no password for the login.

lastchg The number of days between January 1, 1970, and
the date that the password was last modified.

min The minimum number of days required between pass-
word changes.

max The maximum number of days the password is valid.

warn The number of days before password expires that
the user is warned.


So, if the maximum number of days the password is valid is = 28, does that mean that the password has expired?? No-one has changed the password, and I can switch to 'oracle' from 'root' using 'su - oracle' fine.

Also the variables can seen below:

$ whoami
oracle
$ env |grep ORACLE
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=CLFY
ORACLE_DOC=/u01/app/oracle/product/8.1.6/doc
ORACLE_HOME=/u01/app/oracle/product/8.1.6
--------------------------------------------------------------------
$ env |grep oracle
PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/u01/app/oracle/product/8.1.6/bin:/usr/bin:/etc:/usr/ccs/bin:/usr/openwin/bin:/usr/local/bin
ORACLE_BASE=/u01/app/oracle
CLASSPATH=/u01/app/oracle/product/8.1.6/jdbc/lib/class/classes111.zip:
LOGNAME=oracle
ORACLE_DOC=/u01/app/oracle/product/8.1.6/doc
HOME=/home/oracle
LD_LIBRARY_PATH=:/u01/app/oracle/product/8.1.6/lib:/u01/app/oracle/product/8.1.6/jdbc/lib:/u01/app/oracle/product/8.1.6/lib:/u01/app/oracle/product/8.1.6/jdbc/lib:/u01/app/oracle/product/8.1.6/lib:/u01/app/oracle/product/8.1.6/jdbc/lib
ORACLE_HOME=/u01/app/oracle/product/8.1.6
PWD=/home/oracle
----------------------------------------------------------------------------------
$ set |grep ORACLE
ORACLE_BASE=/u01/app/oracle
ORACLE_DOC=/u01/app/oracle/product/8.1.6/doc
ORACLE_HOME=/u01/app/oracle/product/8.1.6
ORACLE_SID=CLFY

Do you think that I still have to set the variables in the script. The script can be seen above in past thread. I believe that it is something to do with the password, what do you think ??

Thanks for your help!
# 9  
Old 11-08-2001
Yeah, it would be to your benefit to add those variables to the top of your script. Remember that if you call sub-scripts, you may need to export the variables.

If you do change the Oracle password, <b>please</b>, for the love of Mel, pick a better password. The last/current one stunk.
# 10  
Old 11-08-2001
crontab user

I have a safer way that we use at work for editing any crontab.

$ crontab -l > tempcron.root
$ vi tempcron.root
$ crontab tempcron.root

This way you always have a copy of your crontab, in this case for root, and if you make any mistakes editing you are not actually messing up the crontab file itself.


Smilie
# 11  
Old 11-08-2001
LivinFree,

I don't even know what the password is. As I said I was handed the system and the procedure was always to switch using 'su - oracle'. Anyway, there is no security issue, so no worries about it.
By the way,.is the password still valid or expired?
Also, why should I inlcude the variables to te script if already are set to env when I log in as oracle??

Kelam_Magnus,

If you read the manual about the crontabs, you will find that the ONLY way to EDIT the crontab is by using 'crontab -e'. If you edit the file itself it will NOT recognise the changes. I am using Solaris 7.

Thanks alot
# 12  
Old 11-08-2001
crontab options

Guest100,

I used to use only "crontab -e" until I found this way of editing the crontab. It is much safer for you and if you make any mistakes it doesn't corrupt your crontab file.

When you look at the options for the manpage for crontab, the first options is "crontab filename".

My only point about saving the crontab out to a file and editing it is 1) so that you will have a copy of it and 2) when you edit this text file that you just saved out, you can execute "crontab filename" to replace the current crontab with the newly edited one. In addition, it prevents you from making a mistake typing while using "crontab -e".

Step 1
Copy out the crontab to a saved file.
$ crontab -l > somefile

Step 2
edit somefile and make changes.
$ vi somefile

Step 3
copy the newly edited file back into place.
$ crontab somefile

This is the safest way to edit the crontab file so that it doesn't get corrupted.

I work for a very large telecom company and this is the company standard for all platforms: SUN, HPUX, and AIX with several different versions on each platform.


In addition, yes you can go to /usr/spool/cron/crontabs and vi the file in question, edit it and save. The file will be recognized by cron because I have done this as well. I have even cut and pasted from a Word document into a telnet session while vi'ing a file in /usr/spool/cron/crontabs file. And there was no corruption of the file when I saved it and ran cron.

Trust me, all of these things work! Can someone else back me up on this? I am not trying to mess you up, only to help you out.


Smilie Smilie
# 13  
Old 11-08-2001
A few comments here. First, cron on Solaris does indeed check to see if a user's password has expired and if so refuses to run cron jobs for that user. And the error message is indeed "bad user". I have never heard of this behavior before, but I have looked this up on Sun's website. Solaris does seem to have a few surprises.

Second, run a cronjob that simply has "env >/tmp/env.out" and you see the need to set environment variables.

Finally, the technique that Kelam_Magus used is valid and a bit safer. "crontab filename" is a valid way to set your crontab.
# 14  
Old 11-08-2001
Guest100, the password is the same as the username...
Try logging in, and you will know very quickly if Oracle can log in.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #526
Difficulty: Medium
In the ASCII Character Table, the first and second column indicate the binary and decimal representation respectively.
True or False?

10 More Discussions You Might Find Interesting

1. Solaris

problem with crontab

hi all does any on has explanation for this result bash-3.00$ crontab -e "/var/tmp/Ex1kayUW" No space left on device The crontab file was not changed. bash-3.00$ (2 Replies)
Discussion started by: osmannix
2 Replies

2. UNIX for Advanced & Expert Users

crontab problem

hi.. i have a program (tf.sh), and i want what it runs automatically with a "lapsus" of 2 hours. (1,3,5,7,9,11,13,15,17,19,21,23 hrs.) i know what i have to do it using crontab, but i donīt know how to do it. i have the next idea, but the problem is what it doesnīt run on my server... (11 Replies)
Discussion started by: DebianJ
11 Replies

3. AIX

Crontab problem

Hi to all. Guys, i have a truble with oracle user crontab. He work if i'm do 0-59 * * * * echo LOL> ~/test.txt But not work if me set realy norm date For example 14 17 28 12 * echo LOL> ~/test.txt In 17:14 28 December . In log file /var/adm/cron/log nothing.... Please... (3 Replies)
Discussion started by: jess_t03
3 Replies

4. Shell Programming and Scripting

Problem in crontab

Hi All, Am facing an issue while updating the crontab.Getting below error while updating the cron. cron/tmp.XXXX5fXBR6: No space left on device crontab: edits left in /tmp/crontab.XXXXEJX5gw Is there any file where i need to alter using root user so that i can update the cron. TIA... (9 Replies)
Discussion started by: Ashok_oct22
9 Replies

5. Shell Programming and Scripting

Crontab Problem

Dear All , I have .sh script wich has the following inside getFileName=Listportfolio.txt.`date +'%Y%m%d` ftp -n 172.10.10.1<<EOF user xxx xxx bin cd /home/gbs/FTP_Script get /home/gbs/FTP_Script/$getFileName bye EOF EOF when I run the... (3 Replies)
Discussion started by: habuzahra
3 Replies

6. UNIX for Advanced & Expert Users

crontab problem

hi all while using crontab -e im receiving 754 as output im unable to add a entry in crontab crontab -l is working fine OS: sun5.8 can some one please assist me (4 Replies)
Discussion started by: NIMISH AGARWAL
4 Replies

7. UNIX for Dummies Questions & Answers

problem with crontab

i added to my crontab file: * * * * * echo "hello" it works, i receive a message into my /var/mail/username and i receive: bob in addition to a large text add-on any help appreciated (1 Reply)
Discussion started by: cleansing_flame
1 Replies

8. UNIX for Dummies Questions & Answers

Problem with crontab

I'm trying to get crontab to run a script, but to test crontab I tried out a very simple command: `echo bob` here is my crontab file (I edited it by using `crontab -e`): ----------------- #!/bin/sh 23 10 * * * echo bob and at 10:23 every day I get a new message: in /var/mail/a... (3 Replies)
Discussion started by: cleansing_flame
3 Replies

9. Shell Programming and Scripting

crontab problem

HI, i am working on linux. i have crontab problem i wrote a small script and put it in a crontab . but the script is not running.. i have given following way in crontab -e 02 06 * * * /bin/csh /home/vr_test.csh but the above script is not running please rectify my... (26 Replies)
Discussion started by: rajan_ka1
26 Replies

10. UNIX for Dummies Questions & Answers

Problem with Crontab

I have a server running 5.9 and I'm trying to cron in the following. 00 01 * * 7 cd /data/apache/logs && find . -type f -name "access.*" -mtime +1 -print |xargs rm > /dev/null 2>&1 But I keep get the following error.... 00 01 * * 7 cd /data/apache/logs && find . -type f -name "access.*"... (2 Replies)
Discussion started by: Zak
2 Replies

Featured Tech Videos