[Frage] scheduler task wird nicht ausgeführt [Gelöst]

  • daFalk daFalk
    Padawan
    0 x
    62 Beiträge
    0 Hilfreiche Beiträge
    24. 04. 2014, 11:04

    Hallo,

    woran liegt es, dass meine tasks nicht aufgeführt werden?

    im Scheduler habe ich einen Task angelegt der alle zwei Minuten ausgeführt werden sollte. Es passiert aber nichts. Die Anzeige zeigt "Late, will run with next execution". Das Logfile im TYPO3 BE bleibt leer.

    Kann mir vielleicht jemand helfen? Wäre klasse!

    Dankeschön, Falk

    meine Konfiguration:

    TYPO3 4.5.5
    Scheduler 1.1.0 (Schedulker check ist alles grün.)
    php 5.3

    auf dem all-inkl server wird die cron.sh aufgerufen mit folgendem Inhalt:

    1. env -i /usr/local/bin/php53 -f www/htdocs/Kundennummer/typo3/cli_dispatch.phpsh scheduler

    Aufruf scheint erfolgreich da ich jedes Mal eine Mail mit dem Inhalt der cron.sh bekomme.

    und eine cron.php

    1. <?php
    2. exec("php53 /www/htdocs/Kundennummer/typo3/cli_dispatch.phpsh scheduler",$ausgabe);
    3. echo "<pre>";print_r($ausgabe);echo "</pre>";
    4. ?>

    meine cli_dispatch.phpsh

    1. #! /usr/bin/php -q
    2. <?php
    3. /***************************************************************
    4. * Copyright notice
    5. *
    6. * (c) 2005-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
    7. * All rights reserved
    8. *
    9. * This script is part of the TYPO3 project. The TYPO3 project is
    10. * free software; you can redistribute it and/or modify
    11. * it under the terms of the GNU General Public License as published by
    12. * the Free Software Foundation; either version 2 of the License, or
    13. * (at your option) any later version.
    14. *
    15. * The GNU General Public License can be found at
    16. * http://www.gnu.org/copyleft/gpl.html.
    17. * A copy is found in the textfile GPL.txt and important notices to the license
    18. * from the author is found in LICENSE.txt distributed with these scripts.
    19. *
    20. *
    21. * This script is distributed in the hope that it will be useful,
    22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
    23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    24. * GNU General Public License for more details.
    25. *
    26. * This copyright notice MUST APPEAR in all copies of the script!
    27. ***************************************************************/
    28.  
    29. /**
    30.  * Command Line Interface module dispatcher
    31.  *
    32.  * $Id$
    33.  *
    34.  * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
    35.  *
    36.  * This script takes a "cliKey" as first argument and uses that to look up the path of the script to include in the end.
    37.  * See configuration of this feature in $TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys'].
    38.  * The point is to have only ONE script dealing with the environment initialization while the actual processing is all a developer should care for.
    39.  *
    40.  */
    41.  
    42. if (substr(php_sapi_name(), 0, 3) == 'cgi') {
    43. // sanity check: ensure that we're running in a shell or cronjob (and NOT via HTTP)
    44. $checkEnvVars = array('HTTP_USER_AGENT', 'HTTP_HOST', 'SERVER_NAME', 'REMOTE_ADDR', 'REMOTE_PORT', 'SERVER_PROTOCOL');
    45. foreach ($checkEnvVars as $var) {
    46. if (array_key_exists($var, $_SERVER)) {
    47. echo 'SECURITY CHECK FAILED! This script cannot be used within your browser!' . chr(10);
    48. echo 'If you are sure that we run in a shell or cronjob, please unset' . chr(10);
    49. echo 'environment variable ' . $var . ' (usually using \'unset ' . $var . '\')' . chr(10);
    50. echo 'before starting this script.' . chr(10);
    51. }
    52. }
    53. unset($checkEnvVars);
    54.  
    55. // mimic CLI API in CGI API (you must use the -C/-no-chdir and the -q/--no-header switches!)
    56. ini_set('html_errors', 0);
    57. ini_set('implicit_flush', 1);
    58. ini_set('max_execution_time', 0);
    59. if (!ini_get('register_argc_argv')) {
    60. $argv = $_SERVER['argv'];
    61. $argc = $_SERVER['argc'];
    62. }
    63. define(STDIN, fopen('php://stdin', 'r'));
    64. define(STDOUT, fopen('php://stdout', 'w'));
    65. define(STDERR, fopen('php://stderr', 'w'));
    66. } elseif (php_sapi_name() != 'cli') {
    67. die('Not called from a command line interface (e.g. a shell or scheduler).' . chr(10));
    68. }
    69.  
    70. // Defining circumstances for CLI mode:
    71. define('TYPO3_cliMode', TRUE);
    72.  
    73. // Get path to this script
    74. $temp_PATH_thisScript = isset($_SERVER['argv'][0]) ? $_SERVER['argv'][0] : (isset($_ENV['_']) ? $_ENV['_'] : $_SERVER['_']);
    75.  
    76. // Figure out if the path is relative
    77. $relativePath = FALSE;
    78. if (stristr(PHP_OS,'win') && !stristr(PHP_OS,'darwin')) {
    79. // Windows
    80. if (!preg_match('/^([A-Z]:)?\\\/', $temp_PATH_thisScript)) {
    81. $relativePath = TRUE;
    82. }
    83. } else {
    84. // *nix, et al
    85. if ($temp_PATH_thisScript{0} != '/') {
    86. $relativePath = TRUE;
    87. }
    88. }
    89.  
    90. // Resolve path
    91. if ($relativePath) {
    92. $workingDirectory = $_SERVER['PWD'] ? $_SERVER['PWD'] : getcwd();
    93. if ($workingDirectory) {
    94. $temp_PATH_thisScript =
    95. $workingDirectory.'/'.preg_replace('/\.\//','',$temp_PATH_thisScript);
    96. if (!@is_file($temp_PATH_thisScript)) {
    97. die('Relative path found, but an error occurred while resolving the absolute path: ' . $temp_PATH_thisScript . chr(10));
    98. }
    99. } else {
    100. die ('Relative path found, but resolving absolute path is not supported on this platform.'.chr(10));
    101. }
    102. }
    103.  
    104. // Define absolute path to this script
    105. define('PATH_thisScript',$temp_PATH_thisScript);
    106.  
    107. if (!isset($_SERVER['argv'][1])) {
    108. die ('The first argument must be a valid key.'.chr(10));
    109. }
    110.  
    111. // First argument is a key that points to the script configuration
    112. define('TYPO3_cliKey', $_SERVER['argv'][1]);
    113.  
    114. // Include init file:
    115. require(dirname(PATH_thisScript).'/init.php');
    116.  
    117. // Make sure output is not buffered,
    118. // so that command-line output and interaction can take place
    119. t3lib_div::flushOutputBuffers();
    120.  
    121. if (defined('TYPO3_cliInclude')) {
    122. include(TYPO3_cliInclude);
    123. } else {
    124. die('No include file configured for key "'.TYPO3_cliKey.'".'.chr(10));
    125. }
    126.  
    127. ?>

  • Schweriner Schwerine...
    Jedi-Ratsmitglied
    1 x
    554 Beiträge
    60 Hilfreiche Beiträge
    24. 04. 2014, 11:07 - Lösung

    Das Problem hatten wir damals auch... war uns einen Blogbeitrag wert :P
    http://blog.teamgeist-medien.de/2014/01/direct-mail-newsletter-automatisch-versenden.html


  • 1
  • 1