Review your favorite Linux distribution.
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-05-2010, 11:51 PM   #1
Registered: Aug 2006
Posts: 38

Rep: Reputation: 15
how to schedule a script in linux


i have oracle installed on Linux i want to schedule a script "" to run in oracle user.

oracle@linux1]crontab -e
*/2 * * * * /tmp/

this script does not execute by cron.


oracle@linux1 tmp] ./ ------executes successfully

I dont know why the script is not being executed by cron

kindly help me
Old 03-06-2010, 12:37 AM   #2
Registered: Oct 2008
Posts: 48

Rep: Reputation: 16
Make sure crond service is running.
# service crond status
crond (pid  2775) is running...
Old 03-06-2010, 12:42 AM   #3
Senior Member
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,629

Rep: Reputation: Disabled
If even cron is running, try this

bash /tmp/ in the cron file.
Old 03-07-2010, 01:27 PM   #4
Registered: Feb 2010
Posts: 36

Rep: Reputation: 20
Originally Posted by farnaw4u View Post

I dont know why the script is not being executed by cron

kindly help me

please, remember that cron commands are executed with a different
environment: for example you do not have the PATH, so commands that
are found from command line are not found from cron.

Just a supposition!

Old 03-07-2010, 01:55 PM   #5
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
To test, create a simple script which will create a file .
make sure to give the whole path to the commands and files.
See if it works.
Then you know the problem is the script, not cron
Old 03-07-2010, 06:31 PM   #6
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,774

Rep: Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537
show the script content; also if it has an error either the cron job owner or root should get an email from cron re any errors. Try


from the cmd line as owner and as root to see.
Also, check /var/log/messages.


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
How to schedule to run a script? ArthurHuang Programming 2 05-22-2009 01:30 AM
Using crontab to schedule a script stuball Linux - Server 9 05-19-2009 07:39 AM
Schedule a script to run philipo Slackware 3 06-22-2007 05:10 PM
Schedule a Script to Run nutthick Linux - Newbie 8 02-02-2005 12:37 PM
Schedule a script every three hours dkochan Linux - General 1 03-07-2004 10:18 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration