|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Environment variables and cron
where do you set environment variables for cron jobs?
I have a feeling it would ignore ~/.bashrc ? thanks. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
You can have a file that declares and exports them which you source as the first step in your command... there are no guarantees WRT the shell cron runs in.
|
| The Following User Says Thank You to Skrynesaver For This Useful Post: | ||
orange47 (08-02-2011) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
what is your os and bash version? do you have a .bashrc file? if you want to set enviroments globaly,you can edit /etc/default/cron. or you can add bash startup scripts to your cron scripts. Code:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.bash ]; then
. ~.bash_profile
firegardss ygemici |
| The Following User Says Thank You to ygemici For This Useful Post: | ||
orange47 (08-02-2011) | ||
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting environment variables in Cron file | shyamu544 | Shell Programming and Scripting | 4 | 07-20-2011 04:43 AM |
| environment variables | radhika03 | Shell Programming and Scripting | 3 | 01-22-2007 12:58 PM |
| Setting environment variables within cron jobs!! | atheek | Solaris | 1 | 10-09-2006 07:26 AM |
| Cron Environment | Smitty McSmith | UNIX for Dummies Questions & Answers | 8 | 07-13-2005 06:31 PM |
| environment variables | Esaia | Programming | 2 | 02-20-2003 07:19 PM |
|
|