LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 06-23-2009, 08:32 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
cronjob not working


hi all......

if i execute file: /home/vinay/new it will display date...

i have setup a cronjob like this..

crontab -e

*/1 * * * * /home/vinay/new

and it got installed............

i have started crond demon still it is not displaying date on each minute..

can anyone please help me why this is not working........

Thanks in advance.........
 
Old 06-23-2009, 09:02 AM   #2
nuwen52
Member
 
Registered: Feb 2009
Distribution: CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 205

Rep: Reputation: 46
Just as a quick test, I created a test script and installed it using your cron line. It worked correctly. Here's the contents of my script:
Code:
#!/bin/sh
date >> /tmp/junk.date
 
Old 06-23-2009, 09:03 AM   #3
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
Quote:
if i execute file: /home/vinay/new it will display date...
Execute from a terminal? The output likely will be shown there.
The chronjob probably runs o.k. - you just don't see the output - because there is no terminal.
All just guessed not knowing anything about your program "new".
 
Old 06-23-2009, 09:06 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,503

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
It looks correct, provided that the file /home/vinay/new have executable permissions. Have you checked if some error message has been sent to your system mail? Or eventually redirect the standard output and the standard error to a file for checking:
Code:
*/1 * * * * /home/vinay/new > /home/vinay/cron.log 2>&1
Also check the file /var/log/cron to see if the cron job has been actually executed. You should see some entries like these:
Code:
Jun 23 16:02:01 linux crond[32620]: (vinay) CMD (/home/vinay/new)
Jun 23 16:03:01 linux crond[32626]: (vinay) CMD (/home/vinay/new)
Jun 23 16:04:01 linux crond[32630]: (vinay) CMD (/home/vinay/new)
 
  


Reply


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
Cronjob stops working after a while ToonM Slackware 4 01-23-2007 12:53 AM
Cronjob not working, stops at lynx prompt abefroman Linux - Server 3 11-01-2006 01:58 PM
Call of Duty 2 Cronjob Not working zend Linux - Software 3 11-15-2005 10:52 AM
cronjob not working but script works dtra Linux - Newbie 4 02-28-2005 05:05 PM
cronjob help meeh Linux - General 1 03-26-2004 11:41 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration