Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 10
Issues With Cron and Catalog price rules
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

I followed the post that said to go to cpanel and enter it there.  im sorry, im a slight novice to php coding, should i be adding a file and then entering in my browser?  I hope someone can help, im learning but im confused w/ how to do this

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

I have attached a file. Open it up and edit the first couple of rows that asks about your database info. Save and upload to your root magento directory. then go to yoursite.com/cronmon.php

If your cron is working you will see a heap of pending and past jobs. To make sure it is working refresh it every 5 minutes (your cron interval) to see new jobs. If your cron is not working you will
a/get an error
b/the jobs will not change.

the other thing is edit the your cron.php file in the magento directory and add the above code( the email one) to the bottom of the file. It will send you an email each time the cron is activated.

File Attachments
cronmon.php  (File Size: 4KB - Downloads: 1754)
 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Thank you so much!!!!!!!!!  i will try this, you’re so sweet to help me with this

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Ok i tried this but im getting an error.  the server spot , i just put the ip of my site right?  i tried both that and my website lurebeauty.com along with my db username/password and db name but im getting:

Magento Cron Schedule
for [username was here]@[server here]

Warning: mysql_connect() [function.mysql-connect]: Host ‘ is not allowed to connect to this MySQL server in /cronmon.php on line 18
Unable to select database

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

No sorry, it needs to be the ip/address of your MYSQL DB. It connects directly to the db to retrieve the cron data.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Ok thanks, I just put in the ip address and then i just put in lurebeauty.com - let me check

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

//================================================================
//insert your database info here
$server='MySQL-V5-004.web24.net.au:3306';
$user='magentouser';
$pass='password123';
$db='Magento_db';
//end data input
//================================================================

Your cronmon.php file should look something like that. The $server variable is the database. Are you using cPanel or plesk? If so you should be able to go in and find your server address. Also you would have had to have it when you did the original install of magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Im actually working on it right now and still couldn’t get it to work but my server address doesn’t look like that.  im using cpanel ... i will look for that info here. 

can i just say im really grateful for your help.

when i did the original install i just needed the db name or ip address but it didnt look like that :( You said the server is the db but theres already a field for the DB at the last line?

I just dont see where to find the variable that looks like your first line

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

It may not look like that. That is how it is in my plesk install, note the port on the end of the address.

Good luck smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

thanks.  no matter what i do it doesnt work.  I put my server ip address, i put the server ip and then rasberryort and it doesnt work, i keep getting “unable to connect to database”

I use a remote store manager and im able to get that to work just fine, yet when i go to the cron job i get an error

Warning: mysql_connect() [function.mysql-connect]: Host ‘174.133.101.14’ is not allowed to connect to this MySQL server in etc etc cronmon.php on line 18
Unable to select database

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Ok i got it, it was just localhost --- that seemed to work.  but everything says pending and “0 jobs successful”

is that right?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

try....

$server='174.133.101.14:3306';
 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 
lurebeauty - 01 September 2009 03:45 AM

Ok i got it, it was just localhost --- that seemed to work.  but everything says pending and “0 jobs successful”

is that right?

yeah, it looks like your cron is not executing.
80 newsletter_send_all pending 2009-08-25 01:04:53 2009-08-25 01:23:00 <=Yours

is when they were scheduled.

it should be about 30-40 pending and about 140 successful
75737 newsletter_send_all pending 2009-09-01 12:45:02 2009-09-01 13:04:00 <=Mine

 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

the top looks like that with all the pendings, but nothing says successful, the only thing its showing is the newsletters waiting to go out.  i dont know what im doing wrong :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Revilo
Member
 
Avatar
Total Posts:  68
Joined:  2009-03-19
 

Ok basicly this is showing that your cron is not executing.

edit your cron.php file (it is in the root directory) and add the following to the end of the file. You just need to change to your email

//email addition

$to "you@yousite.com";
$subject "Cron Mail";
$message "Cron is active "date('l jS \of F Y h:i:s A');
$from "info@lurebeauty.com";
$headers "From: $from";
mail($to,$subject,$message,$headers);

Your file should look like

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

require 'app/Mage.php';

if (!
Mage::isInstalled()) {
    
echo "Application is not installed yet, please complete install wizard first.";
    exit;
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'str_replace(basename(__FILE__), 'index.php'$_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'str_replace(basename(__FILE__), 'index.php'$_SERVER['SCRIPT_FILENAME']);

Mage::app('admin')->setUseSessionInUrl(false);



try 
{
    Mage
::getConfig()->init()->loadEventObservers('crontab');
    
Mage::app()->addEventArea('crontab');
    
Mage::dispatchEvent('default');
catch (Exception $e{
    Mage
::printException($e);
}

$to 
"you@yousite.com";
$subject "Cron Mail";
$message "Cron is active "date('l jS \of F Y h:i:s A');
$from "info@lurebeauty.com";
$headers "From: $from";
mail($to,$subject,$message,$headers);

then refresh, http://www.lurebeauty.com/cron.php

you should get an email sent to you. You now know that when the cron.php file is executed.

Go back to cpanel and edit your cron to execute as previously mentioned.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 10