Solved

make the system run sript every day

Posted on 2006-11-22
5
179 Views
Last Modified: 2010-04-20
How can I run onhand.php every day at 18.00
0
Comment
Question by:teera
[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
5 Comments
 
LVL 84

Assisted Solution

by:ozo
ozo earned 20 total points
ID: 18000131
man cron
0
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 50 total points
ID: 18000133
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
 
LVL 8

Accepted Solution

by:
John Kawakami earned 70 total points
ID: 18000517
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
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 80 total points
ID: 18000581
Assuming the onhand.php is a standalone PHP script, then do

crontab -e

and add

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

0
 
LVL 10

Assisted Solution

by:ssvl
ssvl earned 80 total points
ID: 18001280
# 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

730 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