Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you warn users of a backup

Status
Not open for further replies.

bjdobs

Programmer
Mar 11, 2002
261
CA
Can someone please tell me if there is an AIX command to send all active users a message warning that their application will be shutdown in X minutes?

We have a Progress Database that must be shutdown nightly in order to back it up ... the issue is cron shuts it down at a scheduled time without any warning ... even if the user knows what time the backup is they can still become involved with data entry and loose track of the time which means they loose whatever they were working on ... it would be better if there was a 3 to 5 minute warning popup on the users screen so they can finish what they are doing in time for the shutdown.



 

If they are on the server 'wall' will send a message to all users.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
#!/bin/sh

# To send message to tty with less destructive impact for the screen.


ttys=`ps -ef|grep progres|egrep -v "root"|awk '{
print $6}'|grep tty|sort|uniq`

x=1
while [ $x -le `expr length "$*"` ]
do
bs="$bs\b"
x=`expr $x + 1`
done

for tty in $ttys
do
echo "$*$bs\007\c" > /dev/$tty
done


I hope the backspace option of echo works on AIX

regards Gregor Gregor.Weertman@mailcity.com
 
I think you need to use the [tt]-e[/tt] option to echo to use backslash'd characters. At least I have to on my systems. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top