Cron job not working right

Started by james88, November 28, 2021, 11:44:16 PM

Previous topic - Next topic

james88

cant get the cron job stay working

only time it works when i hit the go button ?

studio4host

make sure you are using ful paths and also check it in the cron files
/var/spool/cron/USERNAME
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

james88

*/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

studio4host

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
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Sandeep

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

james88

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

james88

 "/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


Quote from: 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

james88

panel junk you put command in set it reload the page back to old command back wtf


james88

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

james88

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