Script to create DHCP report

Hi,

In our company, we have been asked to design a script to automate the report of all IP's which are free/used from all the pools in DHCP at any given Amount of time. We have prepare the following script. The problem is when we run the script manually from the command prompt, it brings proper results, but when the same is run via cron daemon, the results come distorted in different lines. Following is the script. Please, suggest something. I believe the issue is of Environment variable, but i cant figure out how to resolve it


#!/bin/bash

/usr/local/bin/dhcpstatus>/report/dhcpreport.log
/usr/local/bin/dhcpstatus|awk '{print $9,",",$11,",",$14,",",$17}'>/report/dhcpreport01.log
grep 1 /report/dhcpreport01.log>/report/dhcpreport03.log
cat /report/dhcpreport03.log | sed "s/^/ `date +"%Y%m%d%H%M",`/">/report/dhcpreport04.csv

Please show us the OK results and the distorted ones so we have a chance to track down the problem.