Hi,
befor sorry for my bad englisch.
I have a Problem with the cron job.
My Hoster allows only http to starts the job.
The i have to use the rcron.php is this right?
I put this in my root directory and give him 777 right.
Then i create a API Key with the IP from the Server and i markt both options.
This API key i insert in the rcron.php
#!/usr/bin/php -q
<?php
/*********************************************************************
rcron.php
PHP script used for remote cron calls.
Peter Rotich <peter@osticket.com>
Copyright (c) 2006-2013 osTicket
http://www.osticket.com
Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.
vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
# Configuration: Enter the url and key. That is it.
# url => URL to api/task/cron e.g http://yourdomain.com/support/api/task/cron
# key => API's Key (see admin panel on how to generate a key)
#
$config = array(
'url'=>'http://ticket.********.de/support/api/task/cron',
'key'=>'6088FC545238E26B9CF493E6E2045844'
);
#pre-checks
function_exists('curl_version') or die('CURL support required');
#set timeout
set_time_limit(30);
#curl post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $config);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '');
curl_setopt($ch, CURLOPT_USERAGENT, 'osTicket API Client v1.7');
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Expect:', 'X-API-Key: '.$config));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result=curl_exec($ch);
curl_close($ch);
if(preg_match('/HTTP\/.* (+) .*/', $result, $status) && $status == 200)
exit(0);
echo $result;
exit(1);
?>
But it not work.
I get a feedback from the Server:
#!/usr/bin/php -q HTTP/1.1 404 Not Found Date: Wed, 10 Apr 2013 19 GMT Server: Apache Vary: Accept-Encoding Content-Length: 219 Content-Type: text/html; charset=iso-8859-1
Not Found
The requested URL /support/api/task/cron was not found on this server.
What is wrong?