?
Solved

make the system run sript every day

Posted on 2006-11-22
5
Medium Priority
?
181 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

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

765 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