LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-29-2005, 02:25 PM   #1
durgap
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Rep: Reputation: 0
crontab not working


I am a new bie to linux. I had never used cron. I had written simple cron entry
$ crontab -e
1,2,3,4,5,6 * * * * echo "hello ..." >> /home/dp/dp 2>&1

I expect to write this "hello...." message to a file /home/dp/dp 6times every hour, But it does not happen.


Pls help me

Durga.
 
Old 08-29-2005, 02:34 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,973
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Try

1,2,3,4,5,6 * * * * echo "hello ..." 2>&1 >> /home/dp/dp

If still nothing happens check crons logfiles.


Cheers,
Tink
 
Old 08-29-2005, 03:09 PM   #3
DeNayGo
Member
 
Registered: Jun 2005
Location: Aachen, Germany
Distribution: Debian
Posts: 74

Rep: Reputation: 16
Well it works on my machine... checked if your cron daemon's running?
Cause when I was new to Linux I didn't even know there was a cron daemon and thus had some problems getting cronjobs to run, too. ^^
 
Old 09-01-2005, 01:53 AM   #4
durgap
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Can you give me the details of cron's log files. If
I had executed a job with CRON, Will it log some some info, that it had executed a job at so and so time. like....
 
Old 09-01-2005, 03:48 AM   #5
kaverong
LQ Newbie
 
Registered: Sep 2004
Location: Philippines
Distribution: CentOS, Gentoo, Ubuntu, Redhat, Fedora. FreeBSD
Posts: 13

Rep: Reputation: 0
cron logs are located at

/var/log/cron
 
Old 09-01-2005, 10:26 AM   #6
durgap
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Before starting my exercise with cron i cleared the contents of /var/log/cron. So that when my job runs it will update the log file, i can easily monitor the log. Now my cron jobs are working, but the /var/log/cron is not being updated. I had restarted the crond daemon. But it still does not update the /var/log/cron.

Pls advise.
 
Old 09-01-2005, 02:38 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,973
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
The alternate way is to have results emailed by
cron ... as root (or the owner of the cronjob) do
a
mail
on the command-line.


Cheers,
Tink
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab nor working navaladi Mandriva 11 01-17-2005 06:58 AM
some commands not working in crontab navaladi Linux - Newbie 2 01-17-2005 06:07 AM
crontab not working subaruwrx Linux - Newbie 8 08-17-2004 09:12 PM
Sample of my /etc/crontab that isn't working..? stakhous Linux - Newbie 1 04-28-2004 04:39 AM
Crontab not working Neorio *BSD 1 12-02-2003 07:34 PM


All times are GMT -5. The time now is 03:36 PM.

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