![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Info req: /var/adm/messages - Kern.warning - different ID messages | Petrucci | SUN Solaris | 1 | 12-04-2008 01:30 PM |
| Command to display nth line before the string is matched. | helper | UNIX for Advanced & Expert Users | 5 | 11-05-2008 12:08 PM |
| A utility for sending complex email messages from the command line | iBot | UNIX and Linux RSS News | 0 | 06-06-2008 05:50 AM |
| Display Printers via command line | gseyforth | Windows & DOS: Issues & Discussions | 3 | 06-28-2006 02:02 AM |
| how to concatenate two command in one line and get the display in one screen | vasikaran | UNIX for Dummies Questions & Answers | 9 | 07-01-2005 06:41 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
display warning messages on command line
I have made a script to print size of a slice if it reaches more then 80% which is working fine no problem in it. I want to add this script in crontab to print this message on command line every half hour if slice size reaches more then 80%. here is the line below i added on crontab 30 * * * * /osp/local/home/linus/test.sh The problem is crontab is running but not displaying any text on command line, i cheched it by redirecting test.sh Code:
#cat test.sh
#/usr/sbin/ksh
#set -x
df -k | grep var |grep c1t0d0s3 > test.txt
cat test.txt | nawk -F " " '{printf "%s\n" , $5}' > test1.txt
#m=`cut -d " " -f 1 test1.txt`
sed 's/%//g' test1.txt > red3
m=`cut -d " " -f 1 red3`
if [ $m -gt 80 ];
then
echo your /var size is $m% kindly remove some space"
echo
fi
#
#
|
|
||||
|
If Syslog is configured to dump certain facility.priority level messages to the console you could check 'logger'. Or maybe else check 'write' or 'wall' but I don't know if crond process owner would be allowed that.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|