The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Description of Environments Supported By.... zizu UNIX for Dummies Questions & Answers 2 02-20-2005 06:52 AM
Unix environments for MS Windows Perderabo Answers to Frequently Asked Questions 0 02-06-2005 03:20 AM
Unix environments to fiddle around with eloquent99 UNIX for Dummies Questions & Answers 1 07-03-2003 10:53 PM
Declaring variable environments in .cshrc v_sharda UNIX for Dummies Questions & Answers 2 09-23-2002 10:25 PM
setting environments xNYx Shell Programming and Scripting 3 03-24-2002 10:03 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-01-2001
SmartJuniorUnix SmartJuniorUnix is offline
Registered User
  
 

Join Date: Sep 2000
Location: UTAH
Posts: 27
Question

I have a user trying to execute a command,in crontab, which requires certain envrionmental variables to be set. He is using tcsh on a Solaris 7 system. I have created a hack by doing the following in the crontab entry...

0 0-23 * * * rsh localhost -l user /path/command

This doesn't seem secure to me.

Any suggestions will be greatly appreciated.

SmartJuniorUnix

[Edited by SmartJuniorUnix on 05-01-2001 at 01:52 PM]
  #2 (permalink)  
Old 05-01-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Just set the environment variables directly in crontab (you can seperate commands with a semi-colon), or put everything in a script, and have crontab excute the script. If you want your .profile (or .cshrc or .login or whatever) to be executed, you will have to do it explicitly in your crontab entry.
  #3 (permalink)  
Old 05-01-2001
98_1LE 98_1LE is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
I think what he is missing is the EDITOR variable. To use vi, execute
Code:
EDITOR=vi; export EDITOR
He may also need to be in the /etc/cron.d/cron.allow file on the local host
  #4 (permalink)  
Old 05-01-2001
SmartJuniorUnix SmartJuniorUnix is offline
Registered User
  
 

Join Date: Sep 2000
Location: UTAH
Posts: 27
PXT,
From what you are saying, it seems as though I can execute a command from crontab prior to running any entries

eg:

/path/.profile
* * * * * command1
* * * * * command2

It this acurate?

Thanks
  #5 (permalink)  
Old 05-01-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Not quite. You would have to do something like:

* * * * * source .profile ; /bin/your_command


Some versions of cron (such as Vixie Cron which is the version running on most Linux machines) will also allow you to have entries such as:

MYVAR="1"


to set environment variables. Check the man page for your crontab to see if it is supported in your version.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0