when I run the script after logging into server it works fine...but when I run the script using CRON it doesn't give me output for total_memory_kb and used_memory ..
can you please explain what you mean by "absolute pathnames in your script"
I have the script in /domain/appplication/memory/ directory which i have included in CRON entry... I get the $used_memory value...I am just not getting the total_memory_kb and used_memory value through CRON...
---------- Post updated at 01:01 PM ---------- Previous update was at 12:23 PM ----------
sorry to rectify the above note:-
can you please explain what you mean by "absolute pathnames in your script"
I have the script in /domain/appplication/memory/ directory which i have included in CRON entry... I get the $free_memory value...I am just not getting the total_memory_kb and used_memory value through CRON...
Try sourcing your .profile in the script. Cron does not automatically source profiles. Different shells use different profiles. I'm assuming you have the Korne shell as your default since you are using ksh in your script. So my example is directed toward the use of the Korne shell as a default shell.
#!/bin/ksh
#
# Source the users profile.
#
# NOTE: There is a space between the first dot (.) and the tilde (~)
#
. ~/.profile