make the system run sript every day

How can I run onhand.php every day at 18.00
teeraAsked:
Who is Participating?
 
John KawakamiConnect With a Mentor Commented:
Read the cron and crontab man pages.

The line you'll want to add to your crontab is:

1 18 * * * /path/to/php /path/to/onhand.php

However, that probably won't work, because most PHP scripts are designed to run within the web server, and invoked by a call from a web browser.

In this case you should get either wget or curl (via your package manager), and use it to get the page via HTTP:

1 18 * * * /path/to/curl http://server/path/to/onhand.php >& /dev/null

The last bit dumps the data out to /dev/null so you don't end up with a new file somewhere.
0
 
ozoConnect With a Mentor Commented:
man cron
0
 
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
You can use a crontab entry for getting the script to run every day.

type man crontab for more info and crontab -e to edit the crontab file.
0
 
TintinConnect With a Mentor Commented:
Assuming the onhand.php is a standalone PHP script, then do

crontab -e

and add

0 18 * * * /path/to/onhand.php

0
 
ssvlConnect With a Mentor Commented:
# crontab -e

1 18 * * * php onhand.php



1 is minute ( it runs in fist minute of the spicfied hr)

18 hour  (

*  day ( * for every)

* month ( month of the Year)

* day of week ( 1 to 7 hence 1 and 7 for sunday)


php (command to exec)

onhand.php (script to exec)

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.