LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-30-2005, 02:25 AM   #1
fahad26
LQ Newbie
 
Registered: Jan 2005
Location: Pakistan
Distribution: Red Hat
Posts: 17

Rep: Reputation: 0
unable to run cron job


Hi

i want to run a cron job.

at the promp i do

crontab -e

then i added

28 11 30 Jun * root echo "I LOVE U"


THE ERROR I GET IN /var/spool/mail/root is that

/bin/sh: root: command not found.


Please help
 
Old 06-30-2005, 02:36 AM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Re: unable to run cron job

Quote:
Originally posted by fahad26
28 11 30 Jun * root echo "I LOVE U"


THE ERROR I GET IN /var/spool/mail/root is that

/bin/sh: root: command not found.
the error is caused because the way you wrote it you are telling cron you want to run the command "root" - which isn't a command... just put the command starting with the echo and you should be fine, since this is root's crontab, the commands wil run as root...
Code:
28 11 30 Jun * echo "I LOVE U"
 
Old 06-30-2005, 02:36 AM   #3
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
SO why did you use that root for?

Remove ther word root in your cron entry and the command will work fine.

Cheers
Z
 
Old 06-30-2005, 02:51 AM   #4
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
You may also want to use "Banner" for your message. It will have a bigger effect...

KC
 
  


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
how to run this cron job ashley75 Linux - General 5 05-24-2004 12:20 PM
shell script fo run auto job in cron JolynnMarie LinuxQuestions.org Member Intro 0 04-28-2004 12:21 PM
Did my Cron job run? ryedunn Linux - Newbie 2 02-25-2004 09:59 AM
Cron job does not run brentos Linux - General 6 12-12-2003 03:37 PM
how to set cron job to run every 5 mins? gsbarry Linux - General 7 05-28-2003 01:30 PM


All times are GMT -5. The time now is 03:46 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