Control Web Panel

WebPanel => CentOS-WebPanel Bugs => Topic started by: james88 on November 28, 2021, 11:44:16 PM

Title: Cron job not working right
Post by: james88 on November 28, 2021, 11:44:16 PM
cant get the cron job stay working

only time it works when i hit the go button ?
Title: Re: Cron job not working right
Post by: studio4host on November 29, 2021, 09:54:44 AM
make sure you are using ful paths and also check it in the cron files
/var/spool/cron/USERNAME
Title: Re: Cron job not working right
Post by: james88 on November 29, 2021, 02:16:34 PM
*/5 * * * * /opt/alt/php-fpm74/usr/php -q /home/xxx/whmcs/crons/cron.php schedule:run 2>&1  #whmcs main
*/5 * * * * /usr/local/bin/php -q /home/xxx/public_html/modules/addons/thesslstorefullv2_admim/tss_cron schedule:run 2>&1
*/5 * * * * /usr/bin/php -q /home/xxx/public_html/modules/addons/thesslstorefullv2_admim/tss_cron.php schedule:run 2>&1
*/5 * * * * /opt/alt/php-fpm74/usr/php -q /home/xxx/whmc/cron/cron.php


only one that works but dont run on schedule  permissions are set
*/5 * * * * /usr/bin/php -q /home/xxx/whmcs/crons/cron.php schedule:run 2>&1
Title: Re: Cron job not working right
Post by: studio4host on November 29, 2021, 02:27:21 PM
you can have different issues, related to extensions or wrong path..you would need to check php path for bin file

example
/opt/alt/php-fpm74/usr/bin/php
/opt/alt/php74/usr/bin/php-cgi

you will need to check with some experienced sysadmin or cwp support
Title: Re: Cron job not working right
Post by: Sandeep on November 29, 2021, 02:28:07 PM
Hi I see you've incorrect path to php binary : "/opt/alt/php-fpm74/usr/php" corerct is "/opt/alt/php-fpm74/usr/bin/php"

also for this run in putty ssh and see what you get ensure login as user xxx via ssh then run this command (you can enable shell access from cwp admin) :
/usr/local/bin/php -q /home/xxx/public_html/modules/addons/thesslstorefullv2_admim/tss_cron schedule:run 2>&1
Title: Re: Cron job not working right
Post by: james88 on November 29, 2021, 02:49:02 PM
ok  can some one tell me what cron job missing in the root cron try running it in root but gone delete old cron and didnt delete right one

24 17 * * * /usr/local/cwp/php71/bin/php -d max_execution_time=18000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_autossl_all_domains.php

0 0 * * * /usr/local/cwp/php71/bin/php -d max_execution_time=18000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/alertandautorenewssl.php

37 0 * * * /root/.acme.sh/acme.sh --cron --home /root/.acme.sh > /dev/null
Title: Re: Cron job not working right
Post by: james88 on November 29, 2021, 03:07:58 PM
 "/opt/alt/php-fpm74/usr/bin/php" dont work ? only one works is /usr/local/bin/php -q /home/xxx/public_html/crons/cron.php
but this wont run at all /usr/local/bin/php -q /home/xxx/public_html/modules/addons/thesslstorefullv2_admim/tss_cron schedule:run 2>&1


Hi I see you've incorrect path to php binary : "/opt/alt/php-fpm74/usr/php" corerct is "/opt/alt/php-fpm74/usr/bin/php"

also for this run in putty ssh and see what you get ensure login as user xxx via ssh then run this command (you can enable shell access from cwp admin) :
/usr/local/bin/php -q /home/xxx/public_html/modules/addons/thesslstorefullv2_admim/tss_cron schedule:run 2>&1
Title: Re: Cron job not working right
Post by: james88 on November 29, 2021, 03:20:23 PM
panel junk you put command in set it reload the page back to old command back wtf

Title: Re: Cron job not working right
Post by: james88 on November 29, 2021, 03:44:06 PM
some time when you go back to fix a long command text some of the command is deleted like end of the command is gone like there a max characters
Title: Re: Cron job not working right
Post by: james88 on November 29, 2021, 08:03:54 PM
omg 6 os reinstalls and now this cron job wants to work

/usr/bin/php -q /home/xxx/public_html/crons/cron.php
/usr/bin/php -q /home/xxx/public_html/modules/addons/thesslstorefullv2_admin/tss_cron.php


centos 7.9
php 7.4.26