Solved

cronjob which executes php script ?

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

785 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