Share your knowledge at the LQ Wiki.
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 04-27-2010, 05:35 AM   #1
LQ Newbie
Registered: Jun 2008
Posts: 15

Rep: Reputation: 0
crontab not working

Hi all, I am using Linux 64 bit Redhat Linux. I am trying to setup simple crontab as follow...

1. Edited crontab file using crontab -e
2. Listed the file once to verify it using crontab -l. This will display as..

18 5 * * 2-3 ksh $HOME/ > $HOME/testscript.out

3. Logged in a root and restarted cron deamon using "/etc/init.d/crond restart"

As per my understanding now my testScript should start running at 5:18 am Thuesday. But this is not getting run.

Please let me know is anything else I need check or configure to make my cron file picked up...
Old 04-27-2010, 05:38 AM   #2
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Rep: Reputation: 36

The entry 2-3 means to run on the 2nd and 3rd day, which according to crontab, is Wednesday and Thursday. Having said that, have you tried running this whole line "ksh $HOME/ > $HOME/testscript.out" from a command prompt, does it work?


Old 04-27-2010, 07:10 AM   #3
LQ Newbie
Registered: Jun 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Hi Stuart,

Thanks for reply. Are you sure 2 is Wed and 3 is Thursday? As per I know...
(0=Sun, 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri, 6=Sat)
Please confirm on this...

Yes the the same command works properly fine from command prompt...
Old 04-27-2010, 07:26 AM   #4
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Since cron uses a limited path, I would suggest to use the whole path to the commands and scripts
/bin/ksh /home/user/ > /home/user/testscript.out
Also make sure to use the whole path in the scripts.

Cron should send an email to the cronuser if there are errors.
Any pointers in the logfiles?

Last edited by repo; 04-27-2010 at 07:37 AM.


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
Crontab is not working, the script is working arfal SUSE / openSUSE 6 02-08-2010 09:48 PM
Crontab is not working Ejdaha Linux - Newbie 15 12-01-2009 06:16 PM
crontab nor working navaladi Mandriva 11 01-17-2005 07:58 AM
crontab not working subaruwrx Linux - Newbie 8 08-17-2004 10:12 PM
Crontab not working Neorio *BSD 1 12-02-2003 08:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:25 PM.

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