To start, use ‘crontab -u asterisk’ to have programs run as the Asterisk user. This avoids the entire ‘runuser’ complication.
For debugging purposes, take the 2>&1 off the end of the commands so you can see whatever the error output is.
Finally, try this crontab command instead:
/usr/sbin/fwconsole ma upgradeall && /usr/sbin/fwconsole reload
This way, the upgrade will run, then (if there are no errors) the reload will run. Getting rid of the output redirection won’t hurt since the output of these command is silence unless there’s an error, and no mail is sent if there’s no output.
Dave,
BIG thanks for your guidance. The commands you mention run perfectly when executed from asterisk user crontab (crontab -u asterisk -e).
What I needed is to execute these commands on a .sh script using root user that changes based on our particular needs, so I followed your guidance that some fwconsole commands are required to be run as asterisk user, and finally the script worked with the following commands in the .sh script: