Sentora Support Forums
Cron Jobs (broken) - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: Cron Jobs (broken) (/showthread.php?tid=2563)



Cron Jobs (broken) - craig@rtech.co.nz - 02-06-2016

Hey guys,

I need to setup a cronjob like :
my_domain_name/index.php?option=com_easysocial&cron=true&phrase=nottellingyou

Comes up with script not found however :
my_domain_name/index.php

Creates the cronjob fine.

So Im guessing Sentora, thinking it's a smart cookie looks for the file name which doesn't exist beyond index.php and spits the dummy. Any ideas on how to fix?


Craig


RE: Cron Jobs (broken) - TGates - 02-07-2016

This may help: http://forums.sentora.org/showthread.php?tid=491&pid=6072#pid6072


RE: Cron Jobs (broken) - Me.B - 02-08-2016

you can create a file mycron.php that curl the URL and setup the cron to run that file.

M B


RE: Cron Jobs (broken) - TGates - 02-08-2016

(02-08-2016, 06:27 AM)Me.B Wrote: you can create a file mycron.php that curl the URL and setup the cron to run that file.

M B
@[Me.B],
Can you post an example on that linked page above? Will be nice to have more examples Wink


RE: Cron Jobs (broken) - Me.B - 02-08-2016

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


RE: Cron Jobs (broken) - MickeMM - 02-08-2016

(02-06-2016, 12:39 PM)craig@rtech.co.nz Wrote: Hey guys,

I need to setup a cronjob like :
my_domain_name/index.php?option=com_easysocial&cron=true&phrase=nottellingyou

Comes up with script not found however :
my_domain_name/index.php

Creates the cronjob fine.

So Im guessing Sentora, thinking it's a smart cookie looks for the file name which doesn't exist beyond index.php and spits the dummy.  Any ideas on how to fix?


Craig
I use joomla to, but for jomsocial. I dont use Sentoras cron, but crontab instead.
crontab -e
This is mine:
*/10 * * * * lynx -source "http://www.my_domain/index.php?option=com_community&task=cron" > /dev/null
Every 10 min it checking jomsocial for sending email or transcode.
If you dont have lynx, just install it with apt-get install lynx


RE: Cron Jobs (broken) - Me.B - 02-09-2016

Why installing lynx?? You already have Wget that can do it or curl.

M B


RE: Cron Jobs (broken) - MickeMM - 02-09-2016

(02-09-2016, 06:47 AM)Me.B Wrote: Why installing lynx?? You already have Wget that can do it or curl.

M B
Lynx has work best for me when i run cron for joomla. U can use wget or curl as you say, but i have got problems with both, thats why i use lynx.