LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-10-2009, 05:53 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
crontab for diffrent user than root doesnt work


Hi all,

I have a huge problem with crontab in CENTOS. In my opinion everything is fine in configuration but it still doesnt work.

I would like to make an oracle user dump with exp command. As everybody knows script must be executed by oracle user. So, I`m going to crontab


Quote:
oracle@myhost# crontab -e
I`m putting new entry to crontab

Quote:
10 1 * * * /backup/scripts/backup-script-oracle.sh
I`m saving crontab.

and nothing... doesnt work.

I have all environment settings in crontab:

Quote:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=dba@mydmomain.com
HOME=/


Maybe somebody can tell me why its not working ?

I dont want to put file to /etc/cron.daily or should I create new folder for that script for example /etc/cron.oracle ?


...help...
 
Old 07-10-2009, 05:56 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Any error messages in the logfiles?
Make sure the script contains the complete path for the commands
 
Old 07-10-2009, 06:06 AM   #3
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by repo View Post
Any error messages in the logfiles?
Make sure the script contains the complete path for the commands
/var/log/cron - no errors, it looks like script was executed by oracle

I have full paths to commands.
 
Old 07-10-2009, 06:38 AM   #4
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Original Poster
Rep: Reputation: 19
problem has been solved


in /etc/crontab

I have put the command

Quote:
05 05 * * * root su - oracle -c "/path/to/script/backup-oracle.sh"
its working like a charm...




I think for command

Quote:
oracle@myhost# crontab -e
I have to put all environments settings like I have in the bash_profile for oracle user. But this should be check.
 
  


Reply

Tags
crontab, execute, user



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
setting root passwd doesnt work ps2cho Linux - Distributions 4 07-01-2005 08:44 AM
pan doesnt connect as user only as root madcow007 Linux - Software 0 06-27-2005 07:58 PM
root user doesnt have permission caged Mandriva 2 05-18-2004 01:55 PM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-05-2004 11:40 PM
root password doesnt work MAGOVIA Linux - Newbie 3 06-30-2003 01:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:51 PM.

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