So I did some research and came up with an answer for my situation that I thought I would share in case it helps others.
First Off - let me describe my setup. I am hosting my Mautic installation on a VPS with root access. My hosting company is Inmotion Hosting. The setup uses WHM / CPANEL.
This method appends to the beginning of a given log file the contents of a divider-entry.txt file then pipes a date/timestamp entry to the log file and then pipes the results of running the Mautic Command to said log file. The steps I took are below:
FIRST: I created a folder under my HOME directory “/home/[USERNAME]/logs-cronjobs” where I store my log files. I also put inside that folder a text file named divider-entry.txt that contains some text such as the following (NOTE THAT LINE 1 & 3 ARE BLANK WITH A CARRIAGE RETURN OR ENTER):
LINE 1: " "
LINE 2: “X-----DIVIDER BETWEEN CRON JOB ENTRIES-----X”
LINE 3: " "
SECOND: I then setup the cron job from the cPanel as follows:
MINUTE=0,15,30,45
HOUR=*
DAY=*
MONTH=*
WEEKDAY=*
COMMAND=
cat /home/[USERNAME]/logs-cronjobs/divider-entry.txt >> /home/[USERNAME]/logs-cronjobs/segments-update.txt 2>&1 && date >> /home/[USERNAME]/logs-cronjobs/segments-update.txt 2>&1 && /usr/local/bin/php /home/[USERNAME]/public_html/EMAIL-mautic/bin/console mautic:segments:update >> /home/[USERNAME]/logs-cronjobs/segments-update.txt 2>&1
The resulting output looks something like this:
X-----DIVIDER BETWEEN CRON JOB ENTRIES-----X
Fri Apr 1 22:01:01 EDT 2022
Rebuilding contacts for segment 1
0 total contact(s) to be added in batches of 300
0 total contact(s) to be removed in batches of 300
0 contact(s) affected
X-----DIVIDER BETWEEN CRON JOB ENTRIES-----X
Fri Apr 1 22:15:02 EDT 2022
Rebuilding contacts for segment 1
0 total contact(s) to be added in batches of 300
0 total contact(s) to be removed in batches of 300
0 contact(s) affected
NOTE: You can also replace the “cat /home/[USERNAME]/logs-cronjobs/divider-entry.txt >> /home/[USERNAME]/logs-cronjobs/segments-update.txt 2>&1” with “echo “XXXXX----NEW ENTRY----XXXXX” >> /home/frugal52/logs-cronjobs/segments-update.txt 2>&1” and get a similar result except without the spaces.
I hope this helps others who want to do something similar.
Have a Great Day!
GEORGE
“The persistent exercise of a little extra effort is one of the most powerful forces contributing to success” - Grit