Solved

cronjob which executes php script ?

Posted on 2002-07-04
3
200 Views
Last Modified: 2012-05-04
hi!
i'm new to linux. i built a server using suse linux 8.0
i would like to execute a php script at special times.
for the first lets say from monday to saturday at
13:00 o'clock. how d0 i do that ?

best regards
ItsMe
0
Comment
Question by:ItsMe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
mnashadka earned 50 total points
ID: 7130659
Assuming that you're php is installed as /bin/php and the script file is "myscript.php", you would edit the crontab by typing crontab -e, then add a line that looks like:

0 13 * * 1,2,3,4,5,6 /bin/php myscript.php

Where the first parameter is the number of minutes after the hour, the second is the hour, the third is the day of the month, the fourth is the month, and the fifth is the day of the week (0-6, 0=Sunday).  Hope this helps.
0
 
LVL 3

Expert Comment

by:mhomann
ID: 7131822
you need do have the exact url to that script.
for example, http://www.servername.com/script.php

now you set up a cron job like this:

0 13 * * * lynx --dump http://www.servername.com/script.php >/dev/null

if that script needs parameters, change the URL accordingly.
0
 

Author Comment

by:ItsMe
ID: 7149118
thanks a lot for both comments!
i'll give the points to the first answerer :-) i will use wget --delete-after .

thanks
Itsme
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question