Script which will run every 10minutes and Send SMS to mobile


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Script which will run every 10minutes and Send SMS to mobile
# 1  
Old 11-10-2010
Script which will run every 10minutes and Send SMS to mobile

Hello Genuis guys,

I am running Aix5 and Oracle 9 on it.

I have sql query which only count a particular rows.

I need to prepare a script which will run that sql query every 10 minutes and if the ouput count is greate than 20. It will send SMS to mobile numbers.

Need your kind help to prepare this.

--Purple
# 2  
Old 11-10-2010
Important questions here:
  • Do you have the count script ready? Or at least attempted to write it? Because we won't write it for you.
  • What attempts did you do so far, and where did they fail? Because, again, we won't write it for you.
  • What command is used to send out SMS? Because without a gateway of some sorts you won't be able to send messages to a mobile network.
# 3  
Old 11-10-2010
First of all I newbie in the shell script. I just need your valuable code. I can then try to modify accordingly if necessary.

1. Yes I have that count script ready. you definately won't write it for me Smilie

2. I have SMS gateway. I can put the gateway address in that script.

Please kindly show me the script.
# 4  
Old 11-10-2010
Just add an entry into your crontab file

For AIX you can locate the crontab in /var/spool/cron/crontabs, each file contains scheduled tasks for each user

best regards
# 5  
Old 11-10-2010
The basic logic would be something like this:
Code:
# Untested, since I've neither got Oracle nor an SMS gateway available
count=$( sqlplus -s user/pw@sid @count_script )
if [ $count -gt 20 ]
then
    # Command to send SMS here
fi

Set up a cron job to run this every 10 minutes and that should do it.
# 6  
Old 11-10-2010
for running at 10mins interval i will add it in crontab. Thats not a problem.

but just to need the script which will fetch the output and send sms. I will first try to save the output in log file. Please tell How to put date and time and append the output in one file" ??

Many Thanks pludi. I will try your scriipt.
# 7  
Old 11-10-2010
Try the 'date' command. It will work by itself, and if you need a specific format, see 'man date' for all its options.

Code:
$ date
Wed Nov 10 15:03:46 CST 2010
$ date "+%Y-%m-%d"
2010-11-10
$

This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Send SMS to mobile

Hello Folks, I need to send the output from shell script to range of mobile phones based on their msisdn . Is there any open source solution could help me to do so from CentOS or redhat ?? (11 Replies)
Discussion started by: arm
11 Replies

2. AIX

send SMS via curl

I need from aix to send an SMS, you know if the command curl serves me (3 Replies)
Discussion started by: tricampeon81
3 Replies

3. UNIX for Dummies Questions & Answers

Need to set up UNIX script to send sms on mobile

Hi All, Can anyone please help in setting up Unix script for sending text messages on mobile?? Actually scenario is we want notification when there is any failures in our processes or if any service goes down we must be notified by a text message on our mobile, we already have email... (3 Replies)
Discussion started by: NikhilM
3 Replies

4. Shell Programming and Scripting

Bash script to send SMS

Hey guys I was wondering how to go about creating a bash script to send SMS..any ideas are appreciated.. (2 Replies)
Discussion started by: blackzeus
2 Replies

5. AIX

AIX Send SMS Directly

Any script / program / command can be run directly to send SMS directly on AIX ? Thanks (2 Replies)
Discussion started by: look1
2 Replies

6. IP Networking

Send SMS from PC to mobile phones

Hi All, Can any expert provide me a guide on how i can send SMS from pc to mobile phone using VBA or some other language ? I am a newbie in networking. (1 Reply)
Discussion started by: Raynon
1 Replies

7. UNIX for Advanced & Expert Users

Unix shell Script To Send SMS

hi , can anyone help with a script to send SMS to some mobile numbers on some conditions. (1 Reply)
Discussion started by: sdcoms
1 Replies

8. Programming

can anyone send sms application

actually i need this sms application ,to gain some knowledge in linux platform. (1 Reply)
Discussion started by: parvathy
1 Replies
Login or Register to Ask a Question