Are you sure that you have permission to write into the log file? Do you have the execute permission set for the script? You do relize that each time that it runs it replaces the log file with the current data.
I'm trying to run the top command using the crontab scheduler. top just doesn't seem to run in cron. It's like it just skips the command. The same thing happens with uptime as well. Here is my script essentially:
#!/bin/bash -l
LOG_FILE=/log/log.file
top -b -n 1 > $LOG_FILE
The top command just doesn't give any output. I can run top just fine from the command line. I'm certain it's some environment variable that I need to set up in cron, but I don't know what it is. Any help would be greatly appreciated.
My OS is SUSE 9.
Thanks

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic