Crontab cannot run by non-root user


 
Thread Tools Search this Thread
Operating Systems AIX Crontab cannot run by non-root user
# 1  
Old 08-20-2007
Crontab cannot run by non-root user

Good morning everybody. I have just receiedv a complaint from our DBA saying that if he create a scripts to run some Oracle performance scripts using crontab and the scheduling part is ok but the job is failed when I checked on /var/adm/cron/log.
I have tried his scripts using Oracle id directly run on shell and everything is ok. But when I set the cron job and the job will fail.
Question :
1) How to check what is the error message for the cron job failed? When I check the log, the only thing it showed is "failed" with no reason.
2) I have also done the checking on whether Oracle is able to run the cron job by checking on cron.allow and cron.deny. Both are ok. I also check on /etc/security/user file whether the deamon of oracle is on "true" and yes, it is. And Oracle is also having sub-group of cron group.
So, is there anything else I can check to find out why the cron job failed?

Tq in advance.
# 2  
Old 08-20-2007
mailx (Solaris)

Hi,
my OS is Solaris but you can try to check the mail account of the user you setup the cronjob.
In solaris the default logging is the mail account (mailx).
Best regards
joerg
# 3  
Old 08-20-2007
Thank you very much for the help. I have finally found the error.
Yes, the error log will post in the mail.
The reason of why it doesn't run is due to eventhough we are using Oracle id to create the cron job, it doesn't mean the job will be run by Oracle priviledge. Thus, to run a Oracle job, we need some setting on the scripts which we did n't do it as normally we run the script using Oracle ID directly and all setting already provided when we sign in as Oracle.
Tq.
# 4  
Old 05-02-2009
Hi kwliew999,

I m also having the same problem.I m running the backupscript through cron with oracle user. but it is giving "sqlplus command not found" . can u tell me what parameter u set in script?
Early reply is awaited.

Thanks in advance.
Surendra
# 5  
Old 05-02-2009
@sur1805
It sounds like your PATH environment variable is not set correctly. You may want to specify the full path to the sqlplus command in the crontab, or make it in to a script which sets this before running sqlplus.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

List of AIX commands that can be run by ROOT user ONLY

Hello, I am testing sudo and I want to test it. Can anyone please let me know few commands (of course other than shutdown, reboot etc. as I can't reboot the box) on AIX that can be run by ROOT only. Thanks ---------- Post updated at 07:43 PM ---------- Previous update was at 07:38 PM... (5 Replies)
Discussion started by: prvnrk
5 Replies

2. Shell Programming and Scripting

How to run script automatically on reboot as root user?

Hi friends,,, I am running one server on Ubuntu 12.04 LTS 32-bit, some times my pc restarts automatically, with no reason, I have a script to start server which requires root password. in this directory /myserver/start_server.sh How can I do this ? and some scripts I am having that I... (1 Reply)
Discussion started by: Akshay Hegde
1 Replies

3. Shell Programming and Scripting

Script to run commands as root user

Hello I have a script which is working fine so far to generate HTML file. Now i am wondering how do i include a syntax where it can change itself to root user and execute a specific commands as root user. Please help, Thanks in advance. -Siddhesh (2 Replies)
Discussion started by: Siddheshk
2 Replies

4. Solaris

Bad user root in crontab

Hi everyone, I got error which is "!bad user (root)" in crontab... I tried changing password, I checked etc/cron/cron.allow and cron.deny, And also I checked the permissions of my files, its(my crontab script) still not working.... Please help... (12 Replies)
Discussion started by: ijustneeda
12 Replies

5. Shell Programming and Scripting

Need to run a bash script that logs on as a non-root user and runs script as root

So I have a script that runs as a non-root user, lets say the username is 'xymon' . This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root. in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies

6. UNIX for Dummies Questions & Answers

Editing crontab of non-root user from file

Hi All, Ref: "build crontab from a text file" in same forum. (I am not allowed to post URL's in the first post) We are reorganizing our UNIX Crontab file by first making changes in a word pad text file. The intent is to then copy it back to Crontab. Will this work? Copy and Paste does not... (6 Replies)
Discussion started by: nivedhitha
6 Replies

7. Shell Programming and Scripting

Get current logged in user from a script run as root.

Ok, so, in order to install some dependencies of a program I made, a script has to be run as root. The thing is that I have to copy some things into the home folder of currently logged in user, but the variable $HOME returns '/root' and the $USER returns 'root' :( Is there any way to see who is... (7 Replies)
Discussion started by: hakermania
7 Replies

8. UNIX for Dummies Questions & Answers

If user has own crontab, results in accumulation of root CRON processes

Hello, I seem to be having a problem with accumulation of root CRON jobs occuring when I have a user's cron job(s) running. Here is an example of a user's crontab file: */1 * * * * echo "hello" > /dev/nullps aux|grep CRON root 14333 0.0 0.0 91236 2172 ? S ... (12 Replies)
Discussion started by: Narnie
12 Replies

9. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

10. Shell Programming and Scripting

run a script on logout by a non-root user

hi , i need to run a script that delete files when i logout as a user other than root user . I have tried out using .bash_logout but that doesnt seem to work , so any alternative for this to be done. Thanks in advance, Harsha (6 Replies)
Discussion started by: harsha10
6 Replies
Login or Register to Ask a Question