Create a job in laravel with command artisan
php artisan make:command ExampleCron --command=example:cron
Navigate to file create in project
app\Console\Commands\ExampleCron.php
Edit method handle, save file
public function handle()
{
\Log::warning('Testando job');
}
Execute command in root user
crontab -e
Create new line
*/1 * * * * cd /your/directory/project && php artisan example:cron >> /dev/null 2>&1
* Todos
1,2,4 Um, dois e Quatro apenas
7-10 De 7 a 10, incluindo 8 e 9
*/5 A qualquer momento, mas com espaço de 5 (ex: 2,7,12,17...)
1-10/3 No intervalo de 1 a 10, mas de 3 em 3 (ex: 2,5,8)
https://laravel.com/docs/5.5/scheduling#introduction
https://linux.die.net/man/5/crontab
Create new job: crontab -e
Check your job is create: crontab -l
In this example I assume you already have laravel and ubuntu 18.04 + installed and configured.
Install a Log-Viewer to verify execute job.
https://github.com/ARCANEDEV/LogViewer