LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2007, 03:14 AM   #1
champak
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Rep: Reputation: 0
cron execution and command access


Hi..
I have problems in executing some of the commands in my shell script when run under user cron. Commands like sendmail(),lsof(),etc
The same script/same entry when executed under root cron(I mean the cron of root) works fine.
Any ideas?
Since the commands are in /usr/sbin probably the user cron not able to access those commands. Is there any place where I should update the path env variable in cron for those commands?

Thanks
 
Old 11-29-2007, 03:34 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
cron has a limited environment,
limited PATH, etc.

the easiest way is to just source a .profile in the cron script
 
Old 11-29-2007, 05:50 AM   #3
champak
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks Billy
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit A Process Cron Execution Time JustinK101 Linux - Software 7 11-20-2007 01:23 AM
Change Execution Time for cron.* Rednarb Ubuntu 2 03-27-2007 03:27 PM
script execution: startup & cron alanvee Linux - Software 3 02-17-2006 01:49 PM
command execution leonidas Linux - General 1 09-22-2004 12:29 AM
randomizing execution of some cron entries markus1982 Linux - General 2 06-28-2003 09:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration