Guten Morgen in die Runde.
Ich habe nach der Anleitung https://www.df.eu/de/support/df-faq/...-faq/cronjobs/eine Datei cron.sh auf dem Serverpfad der Webseite im Root-Verzeichnis abgelegt und mit folgendem Inhalt gefüttert:
Leider wird das Skript nicht ausgeführt.
Der Code für app:create-user lautet wiefoglt:
Es kommt weder eine E-Mail an noch wird die cron.log geschrieben auch wird in der Ausgabe im Kundenmenü bei DomainFactory nichts angegeben. Ich hätte wenigstens aus der ShellScript Datei den
Befehl erwartet.
Offensichtlich mach ich bei dem Aufruf im Cronjob was falsh bzw. in den Einstellungen im Kundenmenü:
Ich habe nach der Anleitung https://www.df.eu/de/support/df-faq/...-faq/cronjobs/eine Datei cron.sh auf dem Serverpfad der Webseite im Root-Verzeichnis abgelegt und mit folgendem Inhalt gefüttert:
Code:
#!/bin/sh echo "Running App Command" env -i /usr/local/bin/php7-72STABLE-CLI -q /pfad/zum/webspace/bin/console app:create-user
Der Code für app:create-user lautet wiefoglt:
PHP-Code:
<?php
/**
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* App\Commands\CreateUserCommand.php
*/
namespace App\Commands;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CreateUserCommand extends Command
{
// the name of the command (the part after "bin/console")
protected static $defaultName = 'app:create-user';
public function __construct(bool $requirePassword = false)
{
// best practices recommend to call the parent constructor first and
// then set your own properties. That wouldn't work in this case
// because configure() needs the properties set in this constructor
$this->requirePassword = $requirePassword;
parent::__construct();
}
protected function configure()
{
$this
// the short description shown while running "php bin/console list"
->setDescription('Creates a new user.')
// the full command description shown when running the command with
// the "--help" option
->setHelp('This command allows you to create a user...')
->addArgument('password',$this->requirePassword ? InputArgument::REQUIRED : InputArgument::OPTIONAL, 'User password')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
// outputs multiple lines to the console (adding "\n" at the end of each line)
$output->writeln([
'User Creator',
'============',
'',
]);
// the value returned by someMethod() can be an iterator (https://secure.php.net/iterator)
// that generates and returns the messages with the 'yield' PHP keyword
//$output->writeln($this->someMethod());
// outputs a message followed by a "\n"
$output->writeln('Whoa!');
// outputs a message without adding a "\n" at the end of the line
$output->write('You are about to ');
$output->write('create a user.');
file_put_contents('cron.log','Test');
@mail('[email protected]',__METHOD__,'cron.sh');
}
}
Code:
echo
Offensichtlich mach ich bei dem Aufruf im Cronjob was falsh bzw. in den Einstellungen im Kundenmenü:
Kommentar