Yeah we cannot figure out how to run our own multithread script as a user other than root. Any suggestions?
The terminal command we use to trigger the script, logged in as any user (www-data, my account, IT Admin’s account) but root:
./multithread_send_test.sh
The script contents:
#!/bin/bash
echo "------------------------------------------------ START SCRIPT "
date
d=`date +%Y-%m-%d`
echo $d
echo "------------------------------------------------ START PHP Commands "
sudo -u www-data php /srv/mautic/bin/console mautic:emails:send --lock_mode=flock --lock-name="1" & sleep 2 & sudo -u www-data php /srv/mautic/bin/console mautic:emails:send --lock_mode=flock --lock-name="2"
echo "------------------------------------------------ END PHP Commands "
date
echo "------------------------------------------------ END SCRIPT "
We have the same issue with trying to user this user’s SmartSend script.