Solved

cronjob which executes php script ?

Posted on 2002-07-04
3
195 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now