The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command to find out "count" of running process ? MITESH KOTHARI Shell Programming and Scripting 4 04-01-2008 04:27 AM
running command "top" in cron freddy1228 UNIX for Dummies Questions & Answers 3 03-18-2008 04:43 PM
Running command "md5" on remote host not working. ynilesh UNIX for Advanced & Expert Users 1 02-01-2008 08:15 AM
communicating wth another user aside from "wall" and "write" Deanne Shell Programming and Scripting 6 05-11-2007 06:43 AM
Unix "at" / "Cron" Command New Problem...Need help Mohanraj UNIX for Dummies Questions & Answers 3 01-26-2006 08:08 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-27-2005
xadamz23 xadamz23 is offline
Registered User
  
 

Join Date: Aug 2003
Posts: 31
Running "wall" command from cron

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?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0