kotakomputer Wrote:
For those experience this Cron issue, here are the summaries:
- make sure /var/spool/cron owned by apache:apache and permissions 770
- make sure /var/spool/cron/apache owned by apache:apache and permissions 660
- the correct cron script path is: your_domain_com/CRONFILE.php or your_domain_com/SUBFOLDER/SUBFOLDER/CRONFILE.php
(Use starting slash CentOS/Ubuntu. No starting slash if using Windows!)
Example for WHMCS Script path is: your_domain_com/admin/cron.php
If arguments need to be passed that do NOT change, simply make a small php file with an include statement like below and call this new cron file instead.
Example new_cron.php:
PHP Code:
<?php
include('path/filename.php?foo=xxx&bar=xxx');
?>
Create a file mycron.php:
Code:
<?php
// create curl resource
$ch = curl_init();
$myurl="my_domain_name/index.php?option=com_easysocial&cron=true&phrase=nottellingyou";
// set url
curl_setopt($ch, CURLOPT_URL, $myurl);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
?>
PHP Docs
http://php.net/manual/en/curl.examples.php
Then create a cron in sentora to run mycron.php.
That would do the trick.
M B
(01-31-2015, 03:45 AM)Me.B Wrote: [ -> ]you can curl it too in php script with the argument.
@[Me.B], can you provide an example? I'm sure it would help out a lot.
(01-31-2015, 03:34 AM)TGates Wrote: [ -> ]If arguments need to be passed that do NOT change, simply make a small php file with an include statement like below and call this new cron file instead.
Example new_cron.php:
PHP Code:
<?php
include('path/filename.php?foo=xxx&bar=xxx');
?>
where shud i update this ? can u please guide me thru since i m starter in linux ...
(10-16-2017, 12:17 AM)CJsent Wrote: [ -> ]where shud i update this ? can u please guide me thru since i m starter in linux ...
You can put it in the same location as the cron file you want to load.
I'm not happy with the way I've set up my cron jobs for Boonex Dolphin. Some things are working including bulk mail, but others are not. Dolphin creates sessions which the cron job is meant to clear on a daily basis, but this is not happening.
During the install process, Dolphin asks for the following cron job to be created:
/usr/local/bin/php -q /home/mysite/public_html/periodic/cron.php
I'm not sure how important the -q (quiet) bit is, but the path to PHP has me confused and I'm not sure if I even need it.
During a typical Dolphin install, it attempts to find the PHP binary using the path /usr/local/bin/php. Sometimes it says PHP is found and sometimes it says it isn't. I'm assuming PHP is actually located at /etc/php5/apache2/ and I've tried both paths. In each instance the sessions aren't being cleared and possibly other things probably aren't working properly either.
Can someone help me create a working new_cron.php which is installed correctly in the public_html/periodic folder.
Here's what I've tried:
<?php
include ('/usr/bin/php -q cron.php');
?>
and
<?php
include ('/etc/php5/apache2/php -q cron.php');
?>
and
<?php
include ('-q cron.php');
?>
Thank You

Why not use Sentora's cron manager? You don't need to call php to run the cron.
If you are using the cron manager, all you need to do is point it at the file you want to run (ie:
domain_com/cron/run_daily.php)
So, in your case, you would add a daily cron job and point it at:
periodic/cron.php
I am using Sentora's cron manager, but the path to php supplied by Boonex confused me.
It is actually required every minute so I've set it thus:
periodic/cron.php
with timing set to 1 minute.
Many Thanks.