Hi,
We're using Linux 3.10.0-693.17.1.el7.x86_64.
I'm trying to kick off a SAS job from cron. I understand cron is a differnt shell than my current session.
Here is my cron line below:
Code:
15 * 1 10 * /usr/bin/bash;. ~/.profile;/home/rscheid/first.bsh cat dog > /home/rscheid/first.out 2>&1
59 3 26 9 * sas -noterminal -batch /sasdata/mids_output02/rjs/simple_run.sas > /sasdata/mids_output02/rjs/simple_run.log
The second cron command just tries to run the SAS command but I think it doesn't work because in cron you lose your PATH am I right?
So I'm using the first cron line to see how I can set the PATH in a cron line. I'm not expecting it to 'carry over' to the second line I just want to see if I can get it to work on its own line. I tried to set the PATH in the first cron line by setting the shell to bash (/usr/bin/bash) then running a .profile script that just set the path to my current session's path (the .profile script is just this line--->PATH= $PATH:/usr/local/bin: /usr/bin:....) I'm using the ';' so I can have multiple commands on the same line.
When I look at the log afterwards I just see the base path which is: /usr/bin:/bin so the assignment didn't work.
I've seen this done.
How can I set the PATH from within cron?