Link to home
Start Free TrialLog in
Avatar of starview
starview

asked on

cron job setup

I have shell excess from my server.

I would like to know how to setup the cron job for the following
using shell commands.

The api service  PHP is installed using the Apache module.

my php file is capture.php.
I need to run this file every 30 minutes every day.
and
mailout.php
I need to run at 23hrs every day.

What I have read is the following, but I am not to sure how to set it up as a shell command.

If your PHP is installed using the Apache module, the approach is a little different. First, you need access to Lynx. Lynx is a small web browser, generally available on Unix and Linux.

Running your PHP script will not require you to add any additional lines. You simply have to edit your /etc/crontab file and add the following line:

* 23 * * * lynx -dump http://www.oneplaceonly.com/eggs/mailout.php 
30 * * * * lynx -dump http://www.oneplaceonly.com/eggs/capture.php 
Please note that in general, you have to specify the entire URL (with "http://" and so on). But depending on your Lynx's configuration, the URL might be relative; I suggest always using the absolute reference as in my example above - it always works.
Avatar of jlevie
jlevie

To set those commands up as cron jobs execute 'crontab -e' and type the lines in.
'crontab -l' will show you what is in your crontab.
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial