cron and executing .login

cron and executing .login

Post by Kate Juli » Tue, 05 Sep 1995 04:00:00



I need to run a job every  night and am having some difficulties. I need
my login script executed prior to set up environment variables and the
path, but I don't know how to do this. Can anyone help.

--Kate

 
 
 

cron and executing .login

Post by Bernhard Nowot » Tue, 05 Sep 1995 04:00:00



Quote:>I need to run a job every  night and am having some difficulties. I need
>my login script executed prior to set up environment variables and the
>path, but I don't know how to do this. Can anyone help.

Depends on the shell you're using:
c-shell: "source <path>/.login"
bourne/korn-shell: ". <path>/.login"
                    ^-------------notice the dot here!

But I suppose you will get in trouble if the job runs a different shell for
this, the settings may be worthless (you may use .profile or .cshrc for
setting variables for all shells). I would suggest using a shell-script
for setting the appropriate variables and start the job then from within.

Hm, do I overlook something (not sure, I'm a little out of shape
today... *cough*...37.9 and raising...:P )?

Bernhard
--

D-85625 Glonn, Germany                           Voice/Fax: +49 08093/2842
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                          MAIL OVER...INSERT COIN!

 
 
 

cron and executing .login

Post by Youri N. Podchos » Tue, 05 Sep 1995 04:00:00



Quote:Nowotny) writes:


|>
|>
|> >I need to run a job every  night and am having some difficulties. I need
|> >my login script executed prior to set up environment variables and the
|> >path, but I don't know how to do this. Can anyone help.
|>
|> Depends on the shell you're using:

I think it's pretty immaterial which shell *she* used to run as
cron *always* uses plain ol' Bourne shell, and you can't change that.

|> c-shell: "source <path>/.login"
|> bourne/korn-shell: ". <path>/.login"
|>                     ^-------------notice the dot here!
|>
|> But I suppose you will get in trouble if the job runs a different shell for
|> this, the settings may be worthless (you may use .profile or .cshrc for
|> setting variables for all shells). I would suggest using a shell-script
|> for setting the appropriate variables and start the job then from within.
|>
|> Hm, do I overlook something (not sure, I'm a little out of shape
|> today... *cough*...37.9 and raising...:P )?
|>

If the stuff to be executed before the scheduled job is really intended
for csh (and it probably is because Kate used term "login script" instead
of ".profile") and as far as it doesn't look like a good idea to duplicate
the same things in two different places, in .login for interactive csh
and in .profile for cron, I'd suggest running the job this way:

mm hh DD MM WW exec csh -c "source .login; whatever-jour-job-consists-of"

+---------------------------------------------------------------------+
| Youri N. Podchosov (ynp) * Davidsohn & Son, Inc. NYC * 718-234-4140 |

+---------------------------------------------------------------------+

 
 
 

1. cron.deny and cron.allow files for CRON management

Hi All

I  can not  seem to be able to  make these files  work. Despite  an
entry  in  cron.deny  file,  the  specific user  can use
the crontab  command  to  submit  a  job  to  cron and  the  job
does  gets  executed.
Crontab  command  is  supposed  to check  entries  in these  files.
Ido not think  this is  happening.

Any  idea  will  be  greatly  appreciated.
Please  send  me an e-mail.

Thanks


2. linux XDMCP

3. Matrox Mystique ands X.

4. HELP! Restore from mysysb fails

5. Is it possible to execute a script with out using cron tab

6. Linux Security Statistics

7. cron does not execute

8. Not quite em86-ing yet.

9. OT: IPCHAINS rules not executing as a CRON job??

10. Cannot execute a script thru cron (SVR4)

11. cron, cannot execute binary file

12. Cron Executing Multiple Times

13. changing group and executing script from cron