LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-27-2010, 03:58 PM   #1
Dryaf
LQ Newbie
 
Registered: Jan 2010
Posts: 17

Rep: Reputation: 0
Crontab


Hello

I created a file which in I tried both :

Code:
MAILTO=""
* * * * * /var/www/scripts/script.php >> /dev/null
Code:
MAILTO=""
* * * * * php /var/www/scripts/script.php >> /dev/null
The user has access to the file all permissions as well as apache too. I used the command crontab to load the table but I didn't see any execution of the script. In /etc/cron.allow file I allowed myself but me only the /etc/cron.deny didn't contain anything.

I don't understand how to proceed, seems to be permissions prob I don't think or the system didn't recognize how to execute php I don't know too.

I use Debian
Thank you
 
Old 01-27-2010, 05:19 PM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
well,
in cron typically you have a limited PATH
whereis php?

try the full path:

/blah/blah/blah/php /var/www/scripts/script.php >> /dev/null
 
Old 01-27-2010, 06:04 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Check if you see the job started in /var/log/syslog. It should list an error message if something is wrong.

If not, add an empty line to the end of the crontab file.

jlinkels
 
Old 01-27-2010, 07:11 PM   #4
Dryaf
LQ Newbie
 
Registered: Jan 2010
Posts: 17

Original Poster
Rep: Reputation: 0
The whereis give me the path : /usr/bin/php so after updating the crontab I still have the issue, I added a void line at the end but still got it not working. In syslog file I see strange line just when I switch from php to the full path but after that all other lines didn't show any message. The message after switching is segfault at 7fdec3a29140 ... error 14 in librt-2.10.1.so

Thank you
 
Old 01-28-2010, 12:53 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Maybe some useful hints here: http://www.htmlcenter.com/blog/runni...pts-with-cron/

A little advice: don't put MAILTO to null, at least in the testing phase. If the crontab is actually executed, any error message or any not-redirected output will be sent to the user (or to root depending on your choice) via mail. An easy and quick way to check messages while testing a new crontab entry!
 
Old 01-28-2010, 05:19 PM   #6
Dryaf
LQ Newbie
 
Registered: Jan 2010
Posts: 17

Original Poster
Rep: Reputation: 0
I didn't enter any Email because I didn't setup a mail server, I am working locally. Instead I inserted an email anyway just to see if it may work but nothing.
Thank you anyway
 
  


Reply



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
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 05:07 AM
crontab rehan21 Linux - Newbie 2 06-05-2009 01:51 PM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 07:15 PM
man crontab(5) vs crontab(1) Canis Polaris Linux - Newbie 2 06-04-2008 04:03 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration