Advertisement:

Author Topic: email_warn_expiration don't sending  (Read 134 times)

Robin

  • Newbie
  • *
  • Posts: 23
email_warn_expiration don't sending
« on: September 08, 2019, 06:59:04 pm »
Hey All best Regards bevor, i hope somebody can Help.

My Problem is that one Email not sending in an cron.
The email name in Adminarea is email_warn_expiration


that's in cron.php:

Code: [Select]
// Hourly crons
    $cron = Cron::newInstance()->getCronByType('HOURLY');
    if( is_array($cron) ) {
        $i_next = strtotime($cron['d_next_exec']);

        if( (CLI && (Params::getParam('cron-type') === 'hourly')) || ((($i_now - $i_next + $shift_seconds) >= 0) && !CLI) ) {
            // update the next execution time in t_cron
            $d_next = date('Y-m-d H:i:s', $i_now_truncated + 3600);
            Cron::newInstance()->update(array('d_last_exec' => $d_now, 'd_next_exec' => $d_next),
                                        array('e_type'      => 'HOURLY'));
           
             osc_runAlert('HOURLY', $cron['d_last_exec']);
           
            // Run cron AFTER updating the next execution time to avoid double run of cron
            $purge = osc_purge_latest_searches();
            if( $purge == 'hour' ) {
                LatestSearches::newInstance()->purgeDate( date('Y-m-d H:i:s', ( time() - 3600) ) );
            } else if( !in_array($purge, array('forever', 'day', 'week')) ) {
                LatestSearches::newInstance()->purgeNumber($purge);
            }
            osc_update_location_stats(true, 'auto');

            // WARN EXPIRATION EACH HOUR (COMMENT TO DISABLE)
            // NOTE: IF THIS IS ENABLE, SAME CODE SHOULD BE DISABLE ON CRON DAILY
            if(is_numeric(osc_warn_expiration()) && osc_warn_expiration()>0) {
                $items = Item::newInstance()->findByHourExpiration(24*osc_warn_expiration());
                foreach($items as $item) {
                    osc_run_hook('hook_email_warn_expiration', $item);
                }
            }

            $qqprefixes = array('qqfile_*', 'auto_qqfile_*');
            foreach ($qqprefixes as $qqprefix) {
                $qqfiles = glob(osc_content_path().'uploads/temp/'.$qqprefix);
                if(is_array($qqfiles)) {
                    foreach($qqfiles as $qqfile) {
                        if((time()-filemtime($qqfile))>(2*3600)) {
                            @unlink($qqfile);
                        }
                    }
                }
            }

            osc_run_hook('cron_hourly');
        }
    }

    // Daily crons
    $cron = Cron::newInstance()->getCronByType('DAILY');
    if( is_array($cron) ) {
        $i_next = strtotime($cron['d_next_exec']);

        if( (CLI && (Params::getParam('cron-type') === 'daily')) || ((($i_now - $i_next + $shift_seconds) >= 0) && !CLI) ) {
            // update the next execution time in t_cron
            $d_next = date('Y-m-d H:i:s', $i_now_truncated + (24 * 3600));
            Cron::newInstance()->update(array('d_last_exec' => $d_now, 'd_next_exec' => $d_next),
                array('e_type'      => 'DAILY'));


            osc_do_auto_upgrade();

            osc_runAlert('DAILY', $cron['d_last_exec']);

            // Run cron AFTER updating the next execution time to avoid double run of cron
            $purge = osc_purge_latest_searches();
            if( $purge == 'day' ) {
                LatestSearches::newInstance()->purgeDate( date('Y-m-d H:i:s', ( time() - (24 * 3600) ) ) );
            }
            osc_update_cat_stats();

            // WARN EXPIRATION EACH DAY (UNCOMMENT TO ENABLE)
            // NOTE: IF THIS IS ENABLE, SAME CODE SHOULD BE DISABLE ON CRON HOURLY
            /*if(is_numeric(osc_warn_expiration()) && osc_warn_expiration()>0) {
                $items = Item::newInstance()->findByDayExpiration(osc_warn_expiration());
                foreach($items as $item) {
                    osc_run_hook('hook_email_warn_expiration', $item);
                }
            }*/

            osc_run_hook('cron_daily');
        }
    }

i have used the daily and hourly nothing have worked on the picture you can see the settings
« Last Edit: September 10, 2019, 07:41:01 pm by Robin »

Dimal

  • Full Member
  • ***
  • Posts: 135
Re: email_warn_expiration don't sending
« Reply #1 on: September 08, 2019, 07:59:08 pm »
(please do not post code like that, use the # Insert Code button)

As for your problem, apparently CRON is not running. Is it ?

Robin

  • Newbie
  • *
  • Posts: 23
Re: email_warn_expiration don't sending
« Reply #2 on: September 10, 2019, 07:44:12 pm »
Yes Dimal its looks so that the Cronjob not really running, you have an idea what's are the Problem?

what i can say, i don't have registered Members.
It's possible that in the Items are the Problems?

Dimal

  • Full Member
  • ***
  • Posts: 135
Re: email_warn_expiration don't sending
« Reply #3 on: September 10, 2019, 08:08:40 pm »
No the problem is within Osclass for years now.

Can you set a manual CRON in your Cpanel ? And disable the build-in cron of Osclass in settings ?


Robin

  • Newbie
  • *
  • Posts: 23
Re: email_warn_expiration don't sending
« Reply #4 on: September 11, 2019, 05:11:38 pm »
Dimal your know one Option in the Phptext?

Robin

  • Newbie
  • *
  • Posts: 23
Re: email_warn_expiration don't sending
« Reply #5 on: September 19, 2019, 07:50:35 pm »
Ok now I have try divergent thinks I called with the server host and I try many thinks self on an local server but nothing work..

i have try crontab -e
and I try different things
Code: [Select]
* * * * * /Applications/MAMP/bin/php/php5.6.40/bin/php /Applications/MAMP/htdocs/marktplatz/oc-includes/osclass/cron.php -p cron -t hourly

* * * * * /Applications/MAMP/bin/php/php5.6.40/bin/php /Applications/MAMP/htdocs/marktplatz/index.php -p cron -t hourly


that's the answer from an script:
Code: [Select]
From administrator@Hermes.local  Thu Sep 19 17:45:01 2019
Return-Path: <administrator@Hermes.local>
X-Original-To: administrator
Delivered-To: administrator@Hermes.local
Received: by Hermes.local (Postfix, from userid 501)
id 77F3930027B04B; Thu, 19 Sep 2019 17:45:00 +0200 (CEST)
From: administrator@Hermes.local (Cron Daemon)
To: administrator@Hermes.local
Subject: Cron <administrator@Hermes> /Applications/MAMP/bin/php/php5.6.40/bin/php /Applications/MAMP/htdocs/marktplatz/oc-includes/osclass/cron.php -p cron -t hourly
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=administrator>
X-Cron-Env: <USER=administrator>
X-Cron-Env: <HOME=/Users/administrator>
Message-Id: <20190919154501.77F3930027B04B@Hermes.local>
Date: Thu, 19 Sep 2019 17:45:00 +0200 (CEST)

ABS_PATH is not loaded. Direct access is not allowed.

i Manipulation the duration time but nothing work I make auto cron on and of and try there different things but again nothing work...

have somebody the same Problem and can Help

Dimal

  • Full Member
  • ***
  • Posts: 135
Re: email_warn_expiration don't sending
« Reply #6 on: September 19, 2019, 08:27:39 pm »
I have no idea what your last posts mean, but in case you want to make an external cron, here is what works:


Code: [Select]
wget https://www.website.com/index.php?page=cron -O /dev/null

gnolino

  • Jr. Member
  • **
  • Posts: 56
Re: email_warn_expiration don't sending
« Reply #7 on: September 20, 2019, 05:10:59 pm »
Hi Robin,
did you check oc_t_cron table?
Hourly cron is working or not?
Did you set autocron on in general setting?
Are you using http or https protocol?
fsockopen is on in php.ini?
« Last Edit: September 20, 2019, 05:13:12 pm by gnolino »