Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
SUSE / openSUSE This Forum is for the discussion of Suse Linux.


  Search this Thread
Old 07-16-2008, 10:03 AM   #1
Registered: May 2007
Location: ny
Distribution: fedora
Posts: 33

Rep: Reputation: 15
Command would not execute within a script

I wrote a script to display disk-quotas. It works fine if I execute it manually. However when I execute it from cron it says ...
"repquota: command not found"
day=`date +%a`
if [[ $day == "Sat" || $day = "Sun" ]]
echo Weekend job will not execute
if [ $day == "Wed" ]
repquota -av > /var/log/quota.log
repquota -avg >> /var/log/quota.log
echo Job not scheduled for today
mailx -s "Result of Quotacheck" root@localhost << EOT
"`cat /var/log/quota.log`"
Also there is no display in the body of the mail only ... ""
Old 07-16-2008, 10:10 AM   #2
LQ Newbie
Registered: Nov 2006
Location: Canada
Distribution: Slackware 11, DSL (Debian), Ubuntu 8.04 (Hardy Heron), Smoothwall, Ophcrack & BackTrack2
Posts: 21

Rep: Reputation: 15
repquota path info..

Try putting the full path to the executable repquota in the cron script, it's probably unable to find it's parent directory in the $PATH variable.

Old 07-16-2008, 10:11 AM   #3
LQ Newbie
Registered: Apr 2006
Posts: 13

Rep: Reputation: 0
The problem is the environment. It can not find the script due to the $PATH. Basically it does not know where the script lives. Add to the script a "env" or "set" statement and dump that to a file and you can compare that env to your environment from your shell/CLI.

The likely fix will be to just specify the full path to the script or to add a path statement to the top of the script. You many need to export the path also but some basic testing will let you know if that is needed.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to execute Source command in a shell script UltraSoul Linux - General 3 09-23-2010 10:13 AM
Execute command with spaces from variable in bash script klo_2k Linux - Newbie 4 04-13-2008 02:59 AM
Execute a windows command from inside a c-cgi-script leamassiot General 51 02-09-2006 10:06 AM
How to execute a command line in a shell script orgazmo Programming 5 05-09-2005 09:16 AM
boot script execute command as non-root user wampfler Linux - Security 7 09-24-2004 04:56 AM > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:51 PM.

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