Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-18-2012, 11:42 AM   #1
Registered: Apr 2010
Posts: 40

Rep: Reputation: 0
crontab with shell

hi all
i am using oracle enterprise linux 5.5, i tried alot to use crontab but unfortunatly did not solve my problem and also search on the net
i want to run the shell script and my crontab is something like this.


22 12 * * * cd /home/oracle/sh >> /u01/rman.log

plz if anyone knows about crontab so plz help me out..thanks in advance.
Old 03-18-2012, 12:33 PM   #2
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 130

Rep: Reputation: 20
i find crontab confusing too - and i am not alone.

i am sure you have done your research but you can have look at this website:

and consider installing something like webmin:

if you find these admin tasks too confusing.

Old 03-18-2012, 03:56 PM   #3
Registered: Oct 2007
Location: Plano, TX
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 70

Rep: Reputation: 26
Hi S@R@H, your post leaves a lot to be asked. For instance, what should the script accomplish? Assuming that your script, which is to be run by cron is comprehensive, my approach would be:
  1. To have everything in a script including the output redirection to file
  2. Alternatively, rather than cd to directory containing script, use the full path e.g. /home/oracle/sh/ >> /u01/rman.log

I think the major caveat is that you do not have command seperation. Maybe introducing a colon or preferably '&&' between the directory /home/oracle/sh and you script may help. It will also be great if you try your scripts on the commandline before adding them to cron.
Old 03-18-2012, 06:02 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,850

Rep: Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585
Also see

You can have only one active definition of a var eg SHELL, in the file. If you have more, the last/latest will be the one that takes effect.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shell Script Not Working with crontab Ankush Raj Linux - Newbie 3 10-17-2011 11:10 AM
Shell Script not Running from Crontab venkatramanj SUSE / openSUSE 3 01-13-2010 05:15 AM
Crontab/Shell Output problem mdx34 Linux - Newbie 5 09-12-2008 04:31 PM
how to run crontab in shell script panselva Linux - General 3 05-08-2008 08:33 PM
crontab job and run on shell sunhui Linux - Software 1 02-13-2007 05:35 AM > Forums > Linux Forums > Linux - Newbie

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

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