Quantcast
Channel: Run bash_profile in cron job - Server Fault
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

Run 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
Browsing all 4 articles
Browse latest View live




Latest Images