Answer by Khaled for Run bash_profile in cron job
If you want to include the variables in the .bash_profile file, you need to source it in your script.Simply executing the script will not include the exported variables.
View ArticleAnswer by cjc for Run bash_profile in cron job
bash /root/.bash_profile will create a new bash process, run that file (and I assume set your env variables while doing so), and then exit, taking those newly set env variables with it.Try ....
View ArticleAnswer by stew for Run bash_profile in cron job
. /root/.bash_profile or source /root/.bash_profile. which says to run that file in the current shell. Your method runs .bash_profile in s subshell, That sets up the variables in the subshell, then...
View ArticleRun bash_profile in cron job
I had a problem that my cron script wasnt loading the environment variables so I added the following line:#!/bin/shbash /root/.bash_profileThis seems to have no effect and the path variables are not...
View Article