maxharrys
maxharrys

Reputation: 37

CRON job with Symfony and mailer

I'm trying to set up a CRON job sending an email to users, using Symfony commands. The emailing part works. If I type the command in the proper directory, I do receive my email.

So I came up with this CRON command : cd /home/c1583306c/public_html && php bin/console app:send-email:send

But when the command is executed, Symfony doesnt seem to recognize my command, here is the output :

Symfony 5.2.3 (env: dev, debug: true)

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "dev"]
      --no-debug        Switches off debug mode.
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  about                                      Displays information about the current project
  help                                       Displays help for a command
  list                                       Lists commands
 app
  app:send-email:send                 My test command
 assets
  assets:install                             Installs bundles web assets under a public directory
 cache
  cache:clear                                Clears the cache

Am I doing something wrong ?

NOTE: I have to specify to folder. Otherwise, this will be the output :

Status: 404 Not Found X-Powered-By: PHP/7.4.15 Content-type: text/html; charset=UTF-8

No input file specified.

Upvotes: 1

Views: 624

Answers (1)

maxharrys
maxharrys

Reputation: 37

My web hoster figured out the solution, without telling me why it wasnt working.

Solution :

/usr/local/bin/php /home/c1583306c/public_html/bin/console app:mail

Upvotes: 1

Related Questions