Solved

Creating a cron job that will run a php script

Posted on 2004-10-20
1
381 Views
Last Modified: 2010-04-21
Hi :)

I know how to do the whole time setup * * * * * thing, and cronjobs are already enabled on my server. (I already have some that backup my DBs automatically every night).

But!  Let's say I wanted to run /home/user/public/script.php in a cronjob. Assuming I wanted the time to be * * * * * ... what would my exact command line be? I'd like to NOT use a .sh file if possible, as I'm not familiar with those. Thanks :)
0
Comment
Question by:runelynx
[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
1 Comment
 
LVL 38

Accepted Solution

by:
yuzh earned 350 total points
ID: 12355943
1) make sure that you have

#!/path-to/php

as the FIRST line of your /home/user/public/script.php

and then make the crontab looks like:

* * * * * /home/user/public/script.php  >/dev/null 2>&1

please do the followings to modify the crontab:
EDITOR=vi
export EDITOR
crontab -e

put your cron record in and save it.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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