Command would not execute within a script
Hi,
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" ]] then echo Weekend job will not execute fi if [ $day == "Wed" ] then repquota -av > /var/log/quota.log repquota -avg >> /var/log/quota.log else echo Job not scheduled for today fi mailx -s "Result of Quotacheck" root@localhost << EOT "`cat /var/log/quota.log`" EOT Also there is no display in the body of the mail only ... "" |
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.
Craig |
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. |
All times are GMT -5. The time now is 10:00 PM. |