Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I get this error because the script has relative paths:
BNZL.L CPI.L JpGraph Error: 25107 Can't write to file "http://www.linuxquestions.org/questions/images/BNZL-CPI.jpg".
Is it better to change the script or is there a way of running the crontab in the var/www/ foldeR?
ALternatively, how can I get the crontab to call a webpage instead and run the script from a URL call?
Be sure your "script.php" has the necessary permissions to be executable ("chmod 755 script.php"). Now you are all set!
If your PHP is installed using the Apache module, the approach is a little different. First, you need access to Lynx (Lynx Browser for more information). Lynx is a small web browser, generally available on Unix and Linux. Running your PHP script will not require you to add any additional lines. You simply have to edit your /etc/crontab file and add the following line:
* * * * * lynx -dump http://www.somedomain.com/cron.php
Please note that in general, you have to specify the entire URL (with "http://" and so on). But depending on your Lynx's configuration, the URL might be relative; I suggest always using the absolute reference as in my example above - it always works. Again execute the following from the command line:
Seems to work and scripts do not need to be esxecutable
Crontab is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in ISC
Cron. Each user can have their own crontab, and though these are files in /var/spool/ , they are not intended
to be edited directly. For SELinux in mls mode can be even more crontabs - for each range. For more see
If the cron.allow file exists, then you must be listed therein in order to be allowed to use this command. If
the cron.allow file does not exist but the cron.deny file does exist, then you must not be listed in the
cron.deny file in order to use this command. If neither of these files exists, only the super user will be
allowed to use this command.
if you get that error you posted, mayeb the filename is incorrect..
and see if you (accidentially) have used an extension (like crontab.txt) and change if needed
Last edited by brownie_cookie; 04-18-2011 at 03:48 AM.
FWIW I run PHP scripts from cron and do it the same way lrtward does except the scripts are neither owned by nor run as root.
I think maybe you are confusing running PHP as an Apache module with just using it as a scripting language. Are your PHP scripts being used as part of pages that Apache is serving? If not, then why are they in /var/www/html/ ?