DevCEDTeam / CED

0 stars 0 forks source link

Descriptions #38

Open DevCEDTeam opened 1 year ago

DevCEDTeam commented 1 year ago

Cron Job CLI command:

Run the scripts as the user mautic by adding "sudo -u mautic"   e.g., sudo -u mautic /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console ...

Mautic file permissions

You can have cron send an email every time it runs a command which produces output. If you do not want an email to be sent for an individual cron job, you can redirect the command’s output to /dev/null. For example: mycommand >/dev/null 2>&1

grep cptest /var/log/cron [root@server ~] sudo grep mautic /var/log/cron | tail -15

[root@server ~] crontab -l -u mautic [root@server ~] mautic:queue:process

CLI Cron Job php path: /usr/local/bin/

mautic:campaigns:update mautic:campaigns:trigger mautic:emails:send mautic:import mautic:email:fetch mautic:iplookup:download

update segments every 15 minutes


update campaigns every 15 minutes starting with an offset of 5 minutes at the beginning of each hour

5-59/15

execute campaigns events every 15 minutes with an offset of 10 minutes

10-59/15

process email queue

2-59/15

import list in the background


Fetch bounce messages

@hourly

DevCEDTeam commented 1 year ago

Time Schedule

Time Schedule

0,15,30,45 <— mautic:segments:update 5,20,35,50 <— mautic:campaigns:update 10,25,40,55 <— mautic:campaigns:trigger 2,7,12,17,22,27,32,37,42,47,52 <- mautic:emails:send

Path to the cache directory /home/mautic/public_html/mautic.devced.com/bin/console

PHP /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console

CLI /usr/local/bin/php --version

5min /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segments:update

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:update

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger

5min /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send

twice a month /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:iplookup:download

add end trail: stop email notifications: /dev/null 2>&1

CLI Commands: which php /usr/local/bin/php

DevCEDTeam commented 1 year ago

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send

2,7,12,17,22,27,32,37,42,47,52 | 5 2,12,22,32,42,52 | 10

DevCEDTeam commented 1 year ago

1min batch

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --limit=150 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=150 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=300 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --batch-limit=900 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1

twice a month | 1,15

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:iplookup:download >/dev/null 2>&1

DevCEDTeam commented 1 year ago

1 min

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --limit=150 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=150 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=300 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --batch-limit=900 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:update >/dev/null 2>&1

Month: 1,15

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:iplookup:download >/dev/null 2>&1

DevCEDTeam commented 1 year ago

removed

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:iplookup:download >/dev/null 2>&1

DevCEDTeam commented 1 year ago

Time Schedule

0,15,30,45 <— mautic:segments:update 5,20,35,50 <— mautic:campaigns:update 10,25,40,55 <— mautic:campaigns:trigger 2,7,12,17,22,27,32,37,42,47,52 <- mautic:emails:send

5min

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segments:update >/dev/null 2>&1

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:update >/dev/null 2>&1

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger>/dev/null 2>&1 

5min
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --batch-limit=300 >/dev/null 2>&1

Option:

twice a month

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:iplookup:download >/dev/null 2>&1

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1

add end trail: stop email notifications: /dev/null 2>&1

CLI Commands: which php /usr/local/bin/php

DevCEDTeam commented 1 year ago

Image

DevCEDTeam commented 1 year ago

1 min

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --limit=150 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=150 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=300 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --batch-limit=900 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1
DevCEDTeam commented 1 year ago

Image

DevCEDTeam commented 1 year ago

joeyk Project Backer 2d You can add a -i, --list-id[=LIST-ID] Specific ID to rebuild. Defaults to all. [default: false]

parameter to the mautic:segments:update command and specify which list you want to update.

Here is a video about creating this on a large scale:https://youtu.be/Ui-zGW7mYhE?si=cw97nTX2KtCjDp6-

Image Image Image Image Image Image

DevCEDTeam commented 1 year ago

Is this the correct cron job sequence syntax order:

/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --limit=300 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=300 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=300 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=12 --batch-limit=900 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=13 --batch-limit=900 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=14 --batch-limit=900 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:update --batch-limit=10 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger --batch-limit=100 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1
/usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1

1 Min

segment:update --batch-limit=900
campaigns:update --batch-limit=10
campaigns:trigger --batch-limit=100
import --limit=500
broadcasts:send --limit=300
mail:send --limit=300

Time your segments by id

**** segment:update --list-id=272
*/5**** segment:update --list-id=271
0*** segment:update --list-id=112
DevCEDTeam commented 1 year ago

Each cron job is set to run every 15 minutes, but they are staggered by 5 minutes to distribute the load more evenly.

*/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --limit=300 >/dev/null 2>&1

5,20,35,50 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=300 >/dev/null 2>&1

10,25,40,55 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=300 >/dev/null 2>&1

15,30,45,0 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger --batch-limit=100 >/dev/null 2>&1

20,35,50,5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1

25,40,55,10 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1
DevCEDTeam commented 1 year ago

Time segments by 3 x IDs to the cron jobs to run in staggered 15-minute intervals, you can use the following syntax:

*/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=ID1 --batch-limit=900 >/dev/null 2>&1

1-59/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=ID2 --batch-limit=900 >/dev/null 2>&1

2-59/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=ID3 --batch-limit=900 >/dev/null 2>&1

Time segments by 4 x IDs to the cron jobs to run in staggered 15-minute intervals, you can use the following syntax:

*/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=12 --batch-limit=900 >/dev/null 2>&1

5-59/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=13 --batch-limit=900 >/dev/null 2>&1

10-59/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=14 --batch-limit=900 >/dev/null 2>&1

15-59/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=4 --batch-limit=900 >/dev/null 2>&1
DevCEDTeam commented 1 year ago

To increase the email upload speed rate for sending email messages in Mautic 4.0, you can modify the cron job configuration as follows:

*/5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=12 --batch-limit=1800 >/dev/null 2>&1
*/5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=13 --batch-limit=1800 >/dev/null 2>&1
*/5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=14 --batch-limit=1800 >/dev/null 2>&1
*/5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --list-id=4 --batch-limit=1800 >/dev/null 2>&1

In this configuration, I have modified the cron schedule to run every 5 minutes instead of every 15 minutes. Additionally, I have increased the --batch-limit parameter value to 1800, which means that it will process 1800 records at a time.

By running the cron job more frequently and increasing the batch limit, you can effectively increase the email upload speed rate for sending email messages in Mautic. However, please note that increasing the batch limit may put more load on your server, so make sure your server can handle the increased workload.

Make sure to update the paths in the cron job configuration to match your Mautic installation directory.

DevCEDTeam commented 1 year ago
*/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --batch-limit=1000 >/dev/null 2>&1
5,20,35,50 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=1000 >/dev/null 2>&1
10,25,40,55 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=1000 >/dev/null 2>&1
15,30,45,0 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger --batch-limit=1000 >/dev/null 2>&1
20,35,50,5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1
25,40,55,10 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1
DevCEDTeam commented 1 year ago

Image

DevCEDTeam commented 1 year ago
*/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:segment:update --batch-limit=900 >/dev/null 2>&1
*/15 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:broadcasts:send --batch-limit=1000 >/dev/null 2>&1
5,20,35,50 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:emails:send --message-limit=1000 >/dev/null 2>&1
10,25,40,55 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:rebuild --batch-limit=1000 >/dev/null 2>&1
15,30,45,0 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:campaigns:trigger --batch-limit=1000 >/dev/null 2>&1
20,35,50,5 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:import --limit=500 >/dev/null 2>&1
25,40,55,10 * * * * /usr/local/bin/php /home/mautic/public_html/mautic.devced.com/bin/console mautic:reports:scheduler >/dev/null 2>&1