Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

environment in cron

Status
Not open for further replies.

surya12

Programmer
Jan 3, 2002
23
0
0
US
Hi

I have seen that environment(even after excuting .profile) is not available to crontab. Can you please help me?

I have put in task.sh:

/bin/ksh .profile
echo $PATH

and to my crontab:

10 * * * * task.sh

and the output gives:

/usr/bin for the echo $PATH.

Thanks in advance.
Surya
 
For reference.

If the script was written sh commands then it would have ran as a ksh.

set is a csh command for declaring variables.
Ged Jones

Top man
 
try to use in your script

su - [user involved] -c "your commands"

Regards
Bandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top