LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-05-2002, 01:47 AM   #1
m_thangbk
LQ Newbie
 
Registered: Jul 2002
Location: Ha Noi, Viet Nam.
Distribution: MDK 8.0, MDK 8.1, RH 7.2, RH 7.3
Posts: 11

Rep: Reputation: 0
Need help on Crontab


I create a file like this to run a script every minute:

SHELL = /bin/sh
MAILTO = prima
#
* * * * * /home/prima/mail.php

I got tons of emails return to me. All of them contain this message:
sh: /home/prima/mail.php
: No such file or directory
The problem is I CAN execute /home/prima/mail.php in the command line, but crond refused to run it.
This is a CPanel based server.
 
Old 08-05-2002, 06:44 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Re: Need help on Crontab

Quote:
Originally posted by m_thangbk

* * * * * /home/prima/mail.php

I got tons of emails return to me. All of them contain this message:
sh: /home/prima/mail.php
: No such file or directory
The problem is I CAN execute /home/prima/mail.php in the command line, but crond refused to run it.
Gidday ...

Maybe my guess is in a totally wrong direction,
but what user did you assign the cron-job to?
You might have a problem with permissions...

Cheers,
Tink
 
Old 08-06-2002, 10:29 AM   #3
naz
Member
 
Registered: Aug 2002
Location: Malaysia
Distribution: RedHat
Posts: 58

Rep: Reputation: 15
what's the first (#!) line at the top of your script? is it pointing to the correct interpreter for your script?

naz
 
Old 08-06-2002, 11:02 AM   #4
m_thangbk
LQ Newbie
 
Registered: Jul 2002
Location: Ha Noi, Viet Nam.
Distribution: MDK 8.0, MDK 8.1, RH 7.2, RH 7.3
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for your helps. I've found the solution . The problem was that the crontab file was created in Windoze and uploaded into the server in binary mode (shame on me ). This made the script's name incorrect ( a Carriage Return character was added into the file name). The errror message made me totally confused
 
  


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
crontab x2??? killahsmurf Slackware 2 05-24-2005 10:53 PM
Crontab wormraper Debian 4 05-15-2005 01:01 AM
How to use crontab ? Dakkar Linux - Newbie 2 01-22-2004 10:49 AM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM
HELP!! crontab karleong Linux - General 9 07-12-2003 10:54 AM


All times are GMT -5. The time now is 12:02 PM.

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