WordPress.org

Ready to get started?Download WordPress

Forums

My webhotel doesnt support crone jobs (5 posts)

  1. PetterRogstad
    Member
    Posted 8 years ago #

    I am not technical at all but managed to install WordPress. I run a program called Blogpower which post blogs by mail. I understand that I need to set up a crone job to get that working but that is not supported by my web hotel.

    I would be greatful to get some advice on this. Do I have to change webhotel or can install a fix?

    Please understand that I am a technical dummy but very grateful for any advice.

  2. Cypher
    Member
    Posted 8 years ago #

    A 'cron' job is a Unix/Linux functionality that allows a task to be run at a pre-determined time or on pre-determined intervals by the system automatically.

    This is usually a service that your web hosting prodiver has to allow you to do, most allow it, but some don't. You would want to contact your webhost and inquire. There is nothing you can do on the user side to make this possible if your webhost doesn't provide you with Cron service.

    Regards

  3. Denis de Bernardy
    Member
    Posted 8 years ago #

  4. PetterRogstad
    Member
    Posted 8 years ago #

    Found this in installation wordpress readmee version 1.5

    "Post via Email
    You can post from an email client! To set this up go to your "Writing" options screen and fill in the connection details for your secret POP3 account. Then you need to set up wp-mail.php to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your wp-mail.php URL. "

    This is really my problem:

    1. my host do not support cron-jobs
    2. I do not understand how to make my website-monitoring services check my wp-mail.php url
    3. Is this neccessary for posting via email?

    If wp-cron solves the problem how do I insert the command that is I understand something like:

    http://domain.com/blogurl/wp-mail.php > /dev/null

    Please be patient with mee. I have no unix knowledge whatsoever but really want wordpress up and running with email posting.

    I have pasted the wp-cron php file if somebody is so point out what needs to be done.

    <?php
    /*
    Plugin Name: wp-cron
    Plugin URI: http://www.skippy.net/
    Description: periodic execution of actions
    Version: 1.0
    Author: Scott Merrill
    Author URI: http://www.skippy.net/

    Copyright (c) 2005 Scott Merrill (skippy@skippy.net)
    Released under the terms of the GNU GPL
    */

    add_action('plugins_loaded', 'wp_cron_init');

    ///////////////////////
    function wp_cron_init() {
    // first, get the current time
    $wp_cron_now = time();
    // fetch the timestamps
    if ( (FALSE === get_option('wp_cron_15_lastrun'))
    || (FALSE === get_option('wp_cron_hourly_lastrun'))
    || (FALSE === get_option('wp_cron_daily_lastrun')) )
    {
    update_option('wp_cron_15_lastrun', $wp_cron_now);
    update_option('wp_cron_hourly_lastrun', $wp_cron_now);
    update_option('wp_cron_daily_lastrun', $wp_cron_now);
    }
    $wp_cron_15_lastrun = get_option('wp_cron_15_lastrun');
    $wp_cron_hourly_lastrun = get_option('wp_cron_hourly_lastrun');
    $wp_cron_daily_lastrun = get_option('wp_cron_daily_lastrun');

    if ($wp_cron_now > ($wp_cron_daily_lastrun + 864000)) {
    update_option('wp_cron_daily_lastrun', $wp_cron_now);
    add_action('shutdown', 'wp_cron_daily_exec');
    }
    if ($wp_cron_now > ($wp_cron_hourly_lastrun + 3600)) {
    update_option('wp_cron_hourly_lastrun', $wp_cron_now);
    add_action('shutdown', 'wp_cron_hourly_exec');
    }
    if ($wp_cron_now > ($wp_cron_15_lastrun + 900)) {
    update_option('wp_cron_15_lastrun', $wp_cron_now);
    add_action('shutdown', 'wp_cron_15_exec');
    }
    }

    //////////////////////////
    // these execute the various hooks
    function wp_cron_15_exec() {
    do_action('wp_cron_15');
    }

    function wp_cron_hourly_exec() {
    do_action('wp_cron_hourly');
    }

    function wp_cron_daily_exec() {
    do_action('wp_cron_daily');
    }

    ?>

  5. skippy
    Member
    Posted 8 years ago #

    This is TOTALLY untested:

    <?php
    /*
    Plugin Name: wp-cron-mail
    Plugin URI: http://www.skippy.net/
    Description: periodically call wp-mail.php
    Version: 1.0
    Author: Scott Merrill
    Author URI: http://www.skippy.net/
    Copyright (c) 2005 Scott Merrill (skippy@skippy.net)
    Released under the terms of the GNU GPL
    */
    add_action('wp_cron_hourly', 'wp_cron_mail');
    function wp_cron_mail() {
    include_once(ABSPATH . '/wp-includes/class-snoopy.php');
    $snoopy = new Snoopy;
    $snoopy->fetchtext(get_bloginfo('home') . '/wp-mail.php');
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags