Solved

cronjob which executes php script ?

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

910 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