Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, can you give an introductory video tutorial? I now have no effect on implementation. #392

Closed
Tokyo-Lei opened this issue Dec 17, 2021 · 1 comment

Comments

@Tokyo-Lei
Copy link

Tokyo-Lei commented Dec 17, 2021

First of all, PHP7.4, centos 7 and Composer are running normally.
Nothing happens during my execution.

file:

include('vendor/autoload.php');
use Crunz\Schedule;
$schedule = new Schedule();

$task = $schedule->run('php -v');
$task->on( '15:10 2021-12-17' );

return $schedule;

crontab -e

* * * * * cd /www/wwwroot/web && vendor/bin/crunz schedule:run

systemctl reload crond
systemctl restart crond

tail -f /var/log/cron

Dec 17 15:58:01 localhost crond[12153]: (root) RELOAD (/var/spool/cron/root)
Dec 17 15:58:01 localhost crond[12153]: (/www/wwwroot/web/vendor/bin/crunz) ERROR (getpwnam() failed)
Dec 17 15:58:01 localhost CROND[12596]: (root) CMD (cd /www/wwwroot/web && vendor/bin/crunz schedule:run)
@PabloKowalczyk
Copy link
Collaborator

Hello, it is highly advised to add path to PHP binary before Crunz (in crontab), for example /path/to/bin/php vendor/bin/crunz schedule:run. Also please see this threat https://stackoverflow.com/questions/41861683/getpwnam-failed-in-bin-sh-only-when-called-from-cron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants