I have a bash script that runs over crontab as root.
On the bottom of that script I want to run another bash script as another user in a subshell (detached).
How can I do that
The normal command would be
/bin/bash /path/myscript.sh
Thanks in advance.
su otheruser -c /path/myscript.sh &
might be a step in the right direction. Since the main script is running as root, it should not require otheruser's password - although doing this thru cron might be a little quirky.