[SOLVED]ISPConfig CronJobs

Isai

New Member
After I switched from shared hosting to VPS, mailwizz stopped sending campaigns. In VPS, I installed ISPCOnfig, to manage almost everything. However, something in cron is not working. Can anyone tell me what is the correct cron entry in ISPConfig for Mailwizz to work?

Thanks!
aeRewLj

EwGaAei
 

Attachments

  • 24-10-2018-13-34-14-20-11-2018-16-07-16.png
    24-10-2018-13-34-14-20-11-2018-16-07-16.png
    113.2 KB · Views: 67
Assuming that you have created the cronjobs and still don't get it to work

Do

# ls -al /etc/cron.d

Then show the result here.

ISPconfig has it's own handling of cronjobs, so crontab is used in another way, it's used for initiating ISPconfig tasks, of which their own cron job handling is one. Instead the cron jobs that are created from within ISP config are stored in /etc/cron.d . Depending on how you installed ISPconfig you might have added a part that is preventing your MW cron jobs to work properly. A simple output from the above command will help me see if that is the problem.
 
Last edited:
If cron is not working, then in your VPS you need add cron in your VPS.

In backend - Miscellaneous - you can see Cron job list. Add that cron.
 
Assuming that you have created the cronjobs and still don't get it to work

Do

# ls -al /etc/cron.d

Then show the result here.

ISPconfig has it's own handling of cronjobs, so crontab is used in another way, it's used for initiating ISPconfig tasks, of which their own cron job handling is one. Instead the cron jobs that are created from within ISP config are stored in /etc/cron.d . Depending on how you installed ISPconfig you might have added a part that is preventing your MW cron jobs to work properly. A simple output from the above command will help me see if that is the problem.

Thanks for trying to help. See below for the cron log. "web6" is where Maiwizz is.

Code:
root@server1:~# ls /etc/cron.d -al                                                                                                                           
total 52                                                                                                                                                     
drwxr-xr-x   2 root root  4096 Nov 20 22:10 .                                                                                                        drwxr-xr-x 118 root root 12288 Nov 19 17:49 ..   
-rw-r--r--   1 root root   281 Jan 24  2016 amavisd-new   
-rw-r--r--   1 root root   260 Nov  4 12:31 awstats     
-rw-r--r--   1 root root   484 Jan 19  2017 certbot  
-rw-r--r--   1 root root   173 Nov 16 01:27 ispc_chrooted_web32  
-rw-r--r--   1 root root  1407 Nov 20 22:10 ispc_chrooted_web6   
-rw-r--r--   1 root root   712 Jan  1  2017 php         
-rw-r--r--   1 root root   102 Oct  7  2017 .placeholder  
-rw-r--r--   1 root root   253 Apr 20  2018 roundcube-core    
-rw-r--r--   1 root root   163 Nov  4 08:02 sync
 
Thanks for trying to help. See below for the cron log. "web6" is where Maiwizz is.

Code:
root@server1:~# ls /etc/cron.d -al                                                                                                                      
total 52                                                                                                                                                
drwxr-xr-x   2 root root  4096 Nov 20 22:10 .                                                                                                        drwxr-xr-x 118 root root 12288 Nov 19 17:49 ..
-rw-r--r--   1 root root   281 Jan 24  2016 amavisd-new
-rw-r--r--   1 root root   260 Nov  4 12:31 awstats
-rw-r--r--   1 root root   484 Jan 19  2017 certbot
-rw-r--r--   1 root root   173 Nov 16 01:27 ispc_chrooted_web32
-rw-r--r--   1 root root  1407 Nov 20 22:10 ispc_chrooted_web6
-rw-r--r--   1 root root   712 Jan  1  2017 php    
-rw-r--r--   1 root root   102 Oct  7  2017 .placeholder
-rw-r--r--   1 root root   253 Apr 20  2018 roundcube-core
-rw-r--r--   1 root root   163 Nov  4 08:02 sync


Yes, it was what I thought.

Edit the file /etc/cron.d/ispc_chrooted_web6

swap out the first lines before the actual cronjob to this:


MAILTO=''
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin


save the file and then for clarity do:

# mv ispc_chrooted_web6 ispc_web6

(the key is that you swap out the shell from the jailkit rooted one to the regular shell)

I would suggest that you had a look at the other job there too (ispc_chrooted_web32). Depending of what it's doing it could be that it doesn't work. Every time you do a change to your cronjobs for Mailwizz, you need to do the above edit.

Did you follow the installation guide for "The Perfect Server" at howtoforge.com?


Good luck!
(please tell me how it went)
 
Last edited:
Yes, it was what I thought.

Edit the file /etc/cron.d/ispc_chrooted_web6

swap out the first lines before the actual cronjob to this:


MAILTO=''
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin


save the file and then for clarity do:

# mv ispc_chrooted_web6 ispc_web6

(the key is that you swap out the shell from the jailkit rooted one to the regular shell)

I would suggest that you had a look at the other job there too (ispc_chrooted_web32). Depending of what it's doing it could be that it doesn't work. Every time you do a change to your cronjobs for Mailwizz, you need to do the above edit.

Did you follow the installation guide for "The Perfect Server" at howtoforge.com?


Good luck!
(please tell me how it went)


OK, @OptiBiz1 ! I followed the recommendations, but cron still does not work.
In cron settings, in ISPConfig, how to do it right?

Option 1:
/usr/bin/php -q wget /var/www/clients/client1/web6/web/apps/console/console.php send-campaigns >/dev/null 2>&1
Option 2:
/usr/bin/php -q /var/www/clients/client1/web6/web/apps/console/console.php send-campaigns >/dev/null 2>&1
Option 3:
wget https://mydomain.com/apps/console/console.php

24-10-2018-13-34-14-20-11-2018-16-07-16-png.6396


Yes! I followed the Howtoforge tutorial.
 
OK, @OptiBiz1 ! I followed the recommendations, but cron still does not work.
In cron settings, in ISPConfig, how to do it right?

Option 1:
/usr/bin/php -q wget /var/www/clients/client1/web6/web/apps/console/console.php send-campaigns >/dev/null 2>&1
Option 2:
/usr/bin/php -q /var/www/clients/client1/web6/web/apps/console/console.php send-campaigns >/dev/null 2>&1
Option 3:
wget https://mydomain.com/apps/console/console.php

24-10-2018-13-34-14-20-11-2018-16-07-16-png.6396


Yes! I followed the Howtoforge tutorial.


When you configure ISPconfig for cron jobs, you need to configure the client in ISPconfig too. In there you need to set full cron, or else you will have to do the following (I know that the creator of ISPconfig told me that he would fix this with the new maintenance update).

Every time that you are changing anything with the cronjobs, you must restore the shell like I showed you. (I don't know what shell you usually run, but you can have a look in e.g. certbot to see what shell it uses, copy that and put it into the ispc_web6 (and if you change the name of that job, you will also see if ISPconfig has anything).

Tough. Are you by any chance using PHP 7.0 as CLI version? I do that still since ISPconfig3 required it before (at least until before 7.2 came - I don't know how it is now). I run all my cronjobs using 7.1 . You could try that.

Check if php7.1 exists, if it does, then try this:

/usr/bin/php7.1 -q /var/www/clients/client1/web6/web/apps/console/console.php send-campaigns >/dev/null 2>&1
 
Last edited:
Did not work!
Yea! I have multiple PHP (5.6, 7.0, 7.1 and 7.2). But for web6 I'm using PHP7.1.


nano /var/www/clients/client1/web6/private.log
"Could not open input file: /var/www/clients/client1/web6/web/apps/console/console.php"


private.log

Code:
Nov 24 17:00:01 server1 CRON[26772]: (web6) CMD (/usr/bin/php7.1 -q /var/www/clients/client1/web6/web/apps/console/console.php process-delivery-and-bounce-log >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log #email.mysite.com)
Nov 24 17:00:01 server1 CRON[26774]: (web6) CMD (/usr/bin/php7.1 -q /var/www/clients/client1/web6/web/apps/console/console.php send-transactional-emails >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log #email.mysite.com)
Nov 24 17:00:01 server1 CRON[26773]: (web6) CMD (/usr/bin/php7.1 -q /var/www/clients/client1/web6/web/apps/console/console.php bounce-handler >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log #email.mysite.com)
Nov 24 17:00:01 server1 CRON[26775]: (web6) CMD (/usr/bin/php7.1 -q /var/www/clients/client1/web6/web/apps/console/console.php hourly >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log #email.mysite.com)
Nov 24 17:00:01 server1 CRON[26777]: (web6) CMD (/usr/bin/php7.1 -q /var/www/clients/client1/web6/web/apps/console/console.php feedback-loop-handler >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log #email.mysite.com)
 
Solved

In the ISPConfig panel:
Client> Edit Client> Limits> Cron Job Limits

Change to "Full Cron".

Correct entry for CronJobs, still in the ISPConfig Dashboard:
/usr/bin/php -q /var/www/clients/client1/web6/web/apps/console/console.php send-campaigns >/dev/null 2>&1

@OptiBiz1 Thanks for the effort to try to help!
 

Attachments

  • 24-10-2018-13-34-14-24-11-2018-23-13-42.png
    24-10-2018-13-34-14-24-11-2018-23-13-42.png
    17.2 KB · Views: 13
Back
Top