Reputation: 660
I created a custom task which works fine on my development machine, but when i uploaded it to the server i get the message bellow.
Task "project:update-countries" is not defined.
Are there any other settings to make so it can run?
Thank you, Radu.
Upvotes: 0
Views: 1514
Reputation: 4721
Make sure that the filename of the uploaded task looks like this:
namespace + task name + "Task.class.php"
Ex: projectUpdateCountriesTask.class.php
Different names results to be not accepted by Symfony so the task will not appear in the internal list of tasks even if in the file was specified the desired namespace and filename.
Upvotes: 0
Reputation: 34107
Change your current working directory to the project's root, and run the command there. In your crontab, it should look like this:
*/15 * * * * cd /path/to/project; time php symfony project:update-countries
Upvotes: 2