weird script in crontab

Hello here's the first line's of the code
that works perfect on command line
but not as a crontab job ???

crontab:

15 * * * * /root/scripts/checkclamd_mem.sh

script:

#!/bin/bash

# Checks Memory of the Clamav-daemon and it's .pid file
# restarts if over the LIMIT. Starts if pid file not found

LOG="/var/log/scripts/checkclamd_mem.log"

# Limit in Mo
LIMIT=120

PID=$(ps waux | grep "clamd" | grep -v "grep" | awk '{ print $2 }')
MEM=$(ps waux | grep "clamd" | grep -v "grep" | awk '{ print $6 }')

the output of PID and MEM:

Why the all those values when running in crontab ?
awk error ??
If someone can help me !!!???

Nils

may be if wiil be helpfull if you write full path to all binary - like /usr/bin/grep and /usr/bin/ps

you can delete 'grep command' - it possiable use only awk:
/usr/bin/ps waux | /usr/bin/awk '/clamd/{ print $2 }'

and may be better in cron use 'nohup' or redirect output like
15 * * * * /root/scripts/checkclamd_mem.sh > /tmp/out.txt 2>&1

It might be that there are multiple clam daemons running, or maybe that clamd is actually a username or something. Try this:

PID=$(ps hax -o pid,cmd | awk '/clamd$/ { print $1; exit; }')
MEM=$(ps wuh $PID | awk '{ print $6 }' )

(The MEM line grabs the memory usage as before, but this time only of the actual PID as found in the previous line.)

thx, no there are no clamd username and just 1 clamd daemon running.
The "exit;" in awk fixed it:

 PID=$(ps hax -o pid,cmd | awk '/clamd$/ { print $1; exit; }')
# and this also
PID=$(ps waux | grep "clamd" | grep -v "grep" | awk '{ print $2; exit; }')  

It now works !! but I still don't understand Why ? the different behaviors
when executed from command line
or executed from crontab