Quote:
Originally Posted by arashi256
Hi,
I'm having some problems getting crond to restart my application server. This application server relies on two environment variables exported from /etc/profile. Does crond have access to these environment variables or do I have to define them in the crontab?
|
I usually declare any needed variables in a script and then use that script in a cron.
I believe you can do something like
Code:
env_var1=
env_var2=
00 4 * * * /path/to/your/start_application/binary
or even
Code:
* * * * * export env_var1=x ; export env_var2=y ; sleep 5s && echo "yo"
and yet, this too may work
Code:
0 5 * * * ./etc/profile ; /path/to/command/to/run
References:
http://stackoverflow.com/questions/2...ontab-will-use
Others may contribute something I missed (early, no coffee, too much coffee).
Please let us know.