LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-14-2005, 05:57 AM   #1
p.gaic
LQ Newbie
 
Registered: Jul 2005
Location: Skopje,Macedonia
Distribution: suse linux sles 9
Posts: 8

Rep: Reputation: 0
problems setting the user in crontab


hi everyone
i'm having a problem executing a sheduled job from crontab

i'm trying to start a backup script for my oracle database from crontab .
the command line in the crontab is :
12 12 * * * /home/oracle/backup.sh

backup.sh is as folows:
exp useid=..... file=...... log =...

as you can see , the command to be executed is "exp" and this command cannot be executed as user root but only as user oracle

i've tried editing the crontab file for the user oracle :
crontab -u oracle -e

but i still get the same error :
exp : command not found
when i start the script manualy , everuthing works just fine

i'm assuming the reason is that crontab is trying to execute the script as root and it cannot recognize the command.
how can i edit the crontab file so that it starts the script as user oracle?????
i've tried to set the crontab like this:
12 12 * * * oracle /home/oracle/backup.sh
but then i get the error :
oracle:command not found

please help , i've tried everything
 
Old 07-14-2005, 11:07 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
cronjobs have a VERY limited path, in some cases just /bin. Your two options are to set a different path in your crontab (PATH=/some/path:/some/other/path:/usr/bin:/bin) or, preferrably, to use an absolute path in your script.

Using a dedicated crontab for oracle is preferred, as I understand, as opposed to cluttering the system-wide crontab.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems setting user permissions kyro_02 Linux - Newbie 4 07-08-2005 11:27 AM
Crontab "root user" problems... Clubber Lang Linux - General 3 09-30-2004 09:29 AM
crontab problems dshafi Linux - General 1 08-19-2004 02:51 AM
Setting up crontab SUSE Linux 8.2 byfaithalone Linux - Newbie 6 02-05-2004 03:42 PM
Setting global variables from a crontab job davee Programming 2 10-06-2003 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration