This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Proper CRON setup
#1
Proper CRON setup
kotakomputer Wrote:  For those experience this Cron issue, here are the summaries:



  1. make sure /var/spool/cron owned by apache:apache and permissions 770
  2. make sure /var/spool/cron/apache owned by apache:apache and permissions 660
  3. 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
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#2
RE: [HOW-TO] Proper CRON setup
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');
?>
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#3
RE: [HOW-TO] Proper CRON setup
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
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Coldfusion Freelance

10$ free to start your VPS

Reply
Thanks given by: TGates
#4
RE: [HOW-TO] Proper CRON setup
(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.
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#5
RE: [HOW-TO] Proper CRON setup
create a php file that call the include using full http curl path:

http://php.net/manual/en/curl.examples.php

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Coldfusion Freelance

10$ free to start your VPS

Reply
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
Ubuntu: How to setup TLS on postfix and dovecot Diablo925 23 30,096 09-02-2017, 01:22 AM
Last Post: DaniCV
Centos 7 : Setup Spamassassin Untouchable 8 18,873 03-26-2017, 06:35 PM
Last Post: chongma
Ubuntu :How to setup Spamassassin Diablo925 17 17,581 07-11-2016, 11:37 PM
Last Post: hayden29

Forum Jump:


Users browsing this thread: 1 Guest(s)