How user crontab?

administrator

Administrator
Nhân viên
9 Tháng tám 2021
63
0
6
This crontab run everyday at every hours to check if video upload already convert to another format.
Note code:
Docker:
- webserver\Dockerfile
Mã:
#setup crontab
COPY crontabs/root /var/spool/cron/crontabs
RUN crontab /var/spool/cron/crontabs/root
RUN touch /var/log/crons.log

- webserver\docker-php-entrypoint.sh
Mã:
service supervisor start
service cron start

- Create file root webserver\crontabs\root
Mã:
* * * * * /usr/local/bin/php /var/www/html/artisan schedule:run >> /var/log/crons.log 2>&1
# Don't remove the empty line at the end of this file. It is required to run the cron job

- File project:
project/app/Console/Kernel.php
Mã:
$schedule->command('job:check')->hourly();