Link to home
Start Free TrialLog in
Avatar of jagguy
jagguyFlag for Australia

asked on

basic cronjob

Hi,

How do I call a function via a cronjob (using php). I am using cpanel.For example I want to print hello world once an hour . The cronjob example are complicated and i cant get  basic function working.

This calls a function but it is for a xero conection so it is more than what I need.
cd /home/aptutori/public_html/mytestserver/app && Console/cake invoicing uploadstatscronjob
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

This is a sample cron job in /etc/cron.d that runs every hour:

0 * * * * user /path/to/php /full/path/to/script.php > /dev/null 2>&1


You will specify the user that you want the cron job to run under, the actual path to php, and the actual path to the php script.

If you want to receive emails remove the "> /dev/null 2>&1".
ASKER CERTIFIED SOLUTION
Avatar of Mark Brady
Mark Brady
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