How to execute a Symfony command as cron job?
<p>I have this simple command in symfony :</p>

<pre><code>use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class AuctionEndCommand extends Command
{
protected function configure()
{
    error_log(print_r('test',true), 3, "/tmp/error.log");

    $this-&gt;setName('desktop:auction_end')-&gt;setDescription('Execute when auction is end.')-&gt;setHelp("Identify winners for auctions");
}
protected function execute(InputInterface $input, OutputInterface $output)
{

    // outputs multiple lines to the console (adding "\n" at the end of each line)
    $output-&gt;writeln([
        'User Creator',
        '============',
        '',
    ]);

    // outputs a message followed by a "\n"
    $output-&gt;writeln('Whoa!');

    // outputs a message without adding a "\n" at the end of the line
    $output-&gt;write('You are about to ');
    $output-&gt;write('create a user.');
}
}
</code></pre>

<p>Now when I execute : <code>/var/www/myProject/bin/console desktop:auction_end</code> this command works fine. But when I try to execute as a cron in linux this script doesn't start :</p>

<p>In linux as sudo I did :
<code>nano crontab -e</code>, and the cron :</p>

<p><code>* * * * * /usr/bin/php /var/www/myProject/bin/console desktop:auction_end &gt; /dev/null</code> </p>

<p>What I'm doing wrong, can you help me please ? Thx in advance and sorry for my english</p>