[SOLVED]ISPConfig CronJobs

Discussion in 'General discussions' started by Isai, Nov 20, 2018.

  1. Isai

    Isai New Member

    Joined:
    Jun 18, 2015
    Messages:
    14
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    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!
    [​IMG]
    [​IMG]
     

    Attached Files:

  2. OptiBiz1

    OptiBiz1 Active Member

    Joined:
    Sep 28, 2015
    Messages:
    380
    Likes Received:
    123
    S.E:
    2024-09-02 01:41:15
    L.T:
    Extended
    L.C:
    21
    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: Nov 21, 2018
    Isai likes this.
  3. Vpul Shah

    Vpul Shah Active Member Support Staff

    Joined:
    Feb 23, 2015
    Messages:
    766
    Likes Received:
    122
    S.E:
    2019-12-22 13:03:57
    L.T:
    Regular
    L.C:
    1
    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.
     
    Isai likes this.
  4. Isai

    Isai New Member

    Joined:
    Jun 18, 2015
    Messages:
    14
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    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
     
  5. Isai

    Isai New Member

    Joined:
    Jun 18, 2015
    Messages:
    14
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
  6. OptiBiz1

    OptiBiz1 Active Member

    Joined:
    Sep 28, 2015
    Messages:
    380
    Likes Received:
    123
    S.E:
    2024-09-02 01:41:15
    L.T:
    Extended
    L.C:
    21

    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: Nov 24, 2018
  7. Isai

    Isai New Member

    Joined:
    Jun 18, 2015
    Messages:
    14
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1

    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

    [​IMG]

    Yes! I followed the Howtoforge tutorial.
     
  8. OptiBiz1

    OptiBiz1 Active Member

    Joined:
    Sep 28, 2015
    Messages:
    380
    Likes Received:
    123
    S.E:
    2024-09-02 01:41:15
    L.T:
    Extended
    L.C:
    21

    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: Dec 9, 2018
  9. Isai

    Isai New Member

    Joined:
    Jun 18, 2015
    Messages:
    14
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    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)
     
  10. OptiBiz1

    OptiBiz1 Active Member

    Joined:
    Sep 28, 2015
    Messages:
    380
    Likes Received:
    123
    S.E:
    2024-09-02 01:41:15
    L.T:
    Extended
    L.C:
    21
    What happens if you run the jobs like that interactively (not as crons) ? One of them should be enough.
     
  11. Isai

    Isai New Member

    Joined:
    Jun 18, 2015
    Messages:
    14
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    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!
     

    Attached Files:

  12. OptiBiz1

    OptiBiz1 Active Member

    Joined:
    Sep 28, 2015
    Messages:
    380
    Likes Received:
    123
    S.E:
    2024-09-02 01:41:15
    L.T:
    Extended
    L.C:
    21

Share This Page