Fedora Version : WS 34
Shell : bash
I have a shell script which will be executed by root from root’s cron job.
Within the shell script, I have commands like below and it will error out (saying
command not found) during cron job if I don’t set the environment variables.
systemctl restart network
To set the environment variables for this script, I can source the
.bashrc files of root user at the beginning of the script.
But, I am thinking of explicilty setting PATH and HOME variables.
I have 2 questions on this :
What should be the values for PATH and HOME variables for the root user?
Any other relevant environment variables which I should set ?