I'm trying to execute several scripts through cron.
Some scripts require being run as different users.
so through cli, I can do:
sudo -u username . /path/to/script.sh
but inside a script that is triggered with cron, this doesn't work.
So I tried it like this:
su --shell=/bin/bash --session-command="/path/to/script.sh" username &