Unix Polling agent


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix Polling agent
# 1  
Old 09-11-2010
Bug Unix Polling agent

I plan to run a script which will run in background and at predefined times send mails to user . I dont have acees to autosys/ Cron / at jobs

My loop works like this

Code:
 
while (true)
do
getx_time=`date +%H%M`
if [ $getx_time == "$file1_time" ]; then

script1.sh
mail_sent_flag=1
elif [ $getx_time == "$file2_time" ]; then

script2.sh
mail_sent_flag=1
elif [ $getx_time == "$file3_time" ]; then

script3.sh
mail_sent_flag=1

if mail_sent_flag=1 

sleep 60 # sleep for a minute so that i don't get bomabred in that minute 
fi
fi
done

Script 1 , Script2 , Script 3 sends mail to my login id
and the time suppose it 0100 , thn i start getting bombarded with mails , I triued using sleep command but of no help

I want only one mail for each of the above 3 cases.

Pls suggest

Last edited by ultimatix; 09-11-2010 at 03:48 PM.. Reason: added new code
# 2  
Old 09-11-2010
MySQL

Quote:
Originally Posted by ultimatix
Code:
if mail_sent_flag=1 

sleep 60 # sleep for a minute so that i don't get bomabred in that minute 
fi

If you want the script to stop for a minute if the mail_set_flag is set to 1 then
Code:
if [ "$mail_sent_flag" -eq 1 ]; then
    sleep 60
fi

Take a look at this post

Last edited by Aia; 09-11-2010 at 05:39 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Polling file

HI I need some help on this below one Have summuary file coming on daily basis with list of file names and count ,if the summuary file not exist ,pool it for every 5 mins till it arrives .Once arrived remove first and last line from the file and check all the files in respective director all... (12 Replies)
Discussion started by: mohan705
12 Replies

2. HP-UX

Polling target on Serviceguard

Hi Guys, we are planning to enable polling target on our SG in reference to this link MC/ServiceGuard: Subnet Goes Down when one of the Cluster Node is Down - HP Customer Care (United States - English) since our server is already in production can we apply the changes with ex. "cmapplyconf... (1 Reply)
Discussion started by: batas
1 Replies

3. Programming

Db polling...

Hi! Im trying to make a program that polls a mysqlDB every 5 minutes. the poll checks a scheduletable in the dB and exicutes a function if there was a "go" in the scheduletable, and if it retrives a "no go" from the table it should just wait for another 5 minutes before re polling the DB, ... (1 Reply)
Discussion started by: karlblau
1 Replies

4. Solaris

NTP polling interval

Is it possible to change the ntp poll manually. I notice that ntp poll is changing autimatically. (1 Reply)
Discussion started by: ningy
1 Replies

5. Infrastructure Monitoring

NCR unix snmp agent

Good Day, I have requirement to monitor a number of NCR unix server for our unix team. As the System Management product that we use in out company does not have an agent for NCR unix I am investigating the SNMP route. I got the unix guys to enable SNMP however, it seems the default MIB that is... (0 Replies)
Discussion started by: priteshj
0 Replies

6. BSD

Backup Exec Agent for Unix

Hi I'd like to backup my freeBSD 7.0 using Backup Exec 12.0 Where to download the Backup Exec Agent for Linux/Unix? (4 Replies)
Discussion started by: ccc
4 Replies

7. UNIX for Advanced & Expert Users

How to avoid polling???

Hi all, I have a directory where some process is keeping incremental/new log files. I need to code a program which will periodically poll this directory and if it founds a new file arrived then copy that new file to some other specific directory. We are OK with this polling approach. I just... (3 Replies)
Discussion started by: zing_foru
3 Replies

8. SCO

Veritas Unix Backup Agent won't start

I have 3 SCO 5.0.5 machines. Two are running the /etc/bkupexec/agent.be just fine but the 3rd fails with a NRL initialization error. It can't seem to find the backup server in the /etc/hosts file. The entry is in the /etc/hosts file. The perms are set correctly on /etc /etc/bkupexec... (0 Replies)
Discussion started by: cnpaul
0 Replies

9. UNIX for Advanced & Expert Users

UNIX Backup Exec Agent Error

Hello, When launching a recently installed UNIX agent for my Veritas backup exec server I receive "getservbyname (grfs, tcp) failed!" I have checked to make sure the service exists under port 6101 and its there. I also removed and recreated the service but still no go. :confused: :confused:... (2 Replies)
Discussion started by: George26
2 Replies

10. Programming

Help - Polling Script

How do I write a shell script to perform polling just like what happens with Microsoft mail. i.e display an alert box. (1 Reply)
Discussion started by: brianmu
1 Replies
Login or Register to Ask a Question