Running "wall" command from cron


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running "wall" command from cron
# 1  
Old 05-27-2005
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?
# 2  
Old 05-27-2005
Nevermind. I figured it out. I had to include the full path to wall. (/usr/sbin/wall)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

2. Shell Programming and Scripting

Problems with "write" and "wall"

Hello, I am using VirtualBox to simulate a small network with two Linux computers, the host is Mac OS X. My problem is that I can't send "write" and "wall" messages from the host to one of those Linux computers. Here is what works: - The virtual Linux computer answers "ping" messages that have... (5 Replies)
Discussion started by: 123_abc
5 Replies

3. Shell Programming and Scripting

expect script not running in cron "Urgent"

I wrote a script to download the files from sftp location to local. while running the script manually its working fine. when i schedule the same in cron its not working.... :wall::wall: here is the script: #!/bin/bash ... (2 Replies)
Discussion started by: ganga39
2 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

6. UNIX for Dummies Questions & Answers

running command "top" in cron

hi all, i would like to collect stat. about the cpu usage every 30 mins so, I set up the cron job sth like 0,30 * * * * * /usr/bin/top -d 1 >> $STAT i know cron doesn't have a TERM output, so error occurs. any ideas or work around for this?? many thanks (3 Replies)
Discussion started by: freddy1228
3 Replies

7. Shell Programming and Scripting

communicating wth another user aside from "wall" and "write"

Hi, Can anyone suggest a Unix command or c-shell algorithm to simulate to behavior of "wall" command minus the "all users"? What I'm trying to do is to send a notice to just one particular user but i dont want other remotely-logged-on users to receive the message (on the pseudo-terminals). I... (6 Replies)
Discussion started by: Deanne
6 Replies

8. UNIX for Dummies Questions & Answers

Need info:"talk,write and wall"

hi nu 2 this forum., can any one tell me how to 'talk' to a person on other system who is connected in a network(LAN) via terminal....... and when to use wall,write and talk.. regards leenus :) (1 Reply)
Discussion started by: mr.anilbabu
1 Replies

9. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies

10. UNIX for Dummies Questions & Answers

How can I deny messaging which use "wall" to send message out?

Dear all, How can I deny messaging which use "wall" command to send message out? regards Wilson (7 Replies)
Discussion started by: wilsonchan1000
7 Replies
Login or Register to Ask a Question