| UNIX/Linux Forum Archives · Rules and Guidelines · Disclaimer |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| xadamz23 |
Posted: May 28 2005, 12:32 AM
|
|
Newbie ![]() Group: Members Posts: 2 Member No.: 1019 Joined: 28-May 05 |
Hello,
Ive written a little script that broadcasts a message if certain criteria are met. The script works fine when I run it. I entered it in the crontab to run every hour on the hour. The script executes, but the wall command doesnt seem to be executing correctly. I only have this problem when running the script from the crontab. My script is below: #!/bin/sh # This script checks for core files and broadcasts a message # to all users if any are found. # Created 02/25/2003 by Adam if [ ! -f /tmp/fndcore.log ] then touch /tmp/fndcore.log #Creates log file if it doesn't exist fi # Check size of log file before updating it SIZE1=`cat /tmp/fndcore.log | wc -c` find / -name core -print > /tmp/fndcore.log #Update log file # Check size of log file after updating it SIZE2=`cat /tmp/fndcore.log | wc -c` if [ $SIZE2 != 0 ] && [ $SIZE1 != $SIZE2 ] then cat /tmp/fndcore.log | wall #Broadcast message fi Any ideas as to why the wall command isnt executing correctly when the script is run through cron? |
| xadamz23 |
Posted: May 28 2005, 12:44 AM
|
|
Newbie ![]() Group: Members Posts: 2 Member No.: 1019 Joined: 28-May 05 |
Nevermind. I figured it out. I had to include the full path to wall. (/usr/sbin/wall)
|
![]() |
![]() ![]() ![]() |