Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

make the system run sript every day

Posted on 2006-11-22
5
Medium Priority
?
182 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 80 total points
ID: 18000131
man cron
0
 
LVL 96

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 200 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 280 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 320 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 320 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
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…
Suggested Courses

636 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