Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

cronjob which executes php script ?

Posted on 2002-07-04
3
Medium Priority
?
205 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 200 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
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.
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

972 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