1

Hello I have built a plugin which has a cron event running. The plugin works well, and has been tested. The script for the cron to run is here.

<crontab>
        <jobs>
            <customconfig>
                <schedule>
                    <cron_expr>*/5 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>customconfig/observer::cronEvent</model>
                </run>
            </customconfig>
        </jobs>
</crontab>  

I have tested the function it is linked to and it works. However the status in the cron_schedule table is pending. So i inserted the following line into cron.php

$isShellDisabled = true;

Still there was no apparent changes. However Now when I go on website.com/cron.php it will run the script and also run the cron jobs needed. The only issue is unless I manually go on website.com/cron.php it will not run the jobs in cron_schedule.

Any ideas what the fault is? How i can overcome it? I need to to be an automatic process.

PS. I have researched into this a lot and used them answers to get this far. however now i can not find any resources which will help me.

Noob
  • 154
  • 1
  • 1
  • 14

2 Answers2

0

Usually your hoster can setup a cronjob which either opens that website via wget, or directly calling console programs.

user5542121
  • 1,051
  • 12
  • 28
  • i use a linux operating system i have tried several times trying to program this however i find that i cannot save it or even exit putty, I need more details if you could provide some??? – Noob Nov 24 '15 at 13:55
  • If you mean how to use cron on linux, please start a new question. I am not really the best to explain that :D But in short; you first install nano `apt-get install nano` then make it default editor `export EDITOR=nano` then try again `crontab -e` By default the editor is vi, that one you can exit by typing `:q` . just to add vi is a powerful text editor. – user5542121 Nov 24 '15 at 14:01
0

TO ANYONE WHO STILL HAS THIS PROBLEM. The solution is simple after alot of research and tampering I found on linux that if you go into putty and type in the command below

sudo crontab -u apache -e

This will allow you to create cron jobs, Now when you type this command in you will be able to create the cron job you want. In magento case type the script below. REMEMBER TO substitute the path for your own path.

* * * * * ! test -e /path/to/website/maintenance_flag && /bin/bash /path/to/website/scheduler_cron.sh --mode always

* * * * * ! test -e /path/to/website/maintenance_flag && /bin/bash /path/to/website/scheduler_cron.sh --mode default

The script above will run your cron jobs in Magento. You can optinally even add this command aswell (at the top) and it will email you any messages feom your cron job.

MAILTO"EMAIL.COM"

Optionally you can download the plugin AOE SCHEDULER. this is a really good plugin for managing your cronjobs, You can easilz tell what cronjobs are running how long the tasks tell. You can basically manage your cron jobs. THIS PLUGIN also helps you setup your cron jobs if you are not running it correctly.

http://www.magentocommerce.com/magento-connect/aoe-scheduler.html

Please Note. If you try to install it from the magento connect and you get the following error. The solution is simple.

Magento Community Edition 1.9.2 Update failed - Unknown cipher in list: TLSv1

In the file downloader/lib/Mage/HTTP/Client/Curl.php Change the code

$this->curlOption(CURLOPT_SSL_CIPHER_LIST, 'TLSv1'); 

to

if(isset($var)){$this->curlOption(CURLOPT_SSL_CIPHER_LIST, 'TLSv1');}
Community
  • 1
  • 1
Noob
  • 154
  • 1
  • 1
  • 14