How to test the script for every 30 mins


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to test the script for every 30 mins
# 1  
Old 02-28-2011
Data How to test the script for every 30 mins

Test job to make sure pwctest service is up
Test script which can run every 30 mins to make sure pwctest is available.
a) If Error , script should send email to Tech.

plz help me out for this script

i'm waiting for reply.....plz
# 2  
Old 02-28-2011
What have you tried so far? Show an excerpt of your script using code tags, thanks. You can use cron to trigger it every 30 minutes.
# 3  
Old 02-28-2011
Im totally new to this system so i don't know how to write it if possible can u plz post the example for that script?
# 4  
Old 02-28-2011
No, why don't you try it and we help you to correct errors?
# 5  
Old 02-28-2011
Power

I tried like following way
30 * * * * ./pwctest

i know this much after that....how to keep in if loop if i get error means how to send a mail??
plz give me proper code or guide me i try my slef...
# 6  
Old 02-28-2011
Quote:
30 * * * * ./pwctest
... is not a good idea, since a) you do use a relative path (use absolute paths, as the cronjob does not use your environment) and b) you don't redirect any errors etc. to a logfile (if not inside the script).
Check out this guide on cron jobs:
Senior Advisor - https://www.unix.com

The forum has a search function. There will be plenty of examples if you search the "Shell Programming and Scripting" area for the string "send mail".

Or check out this, for mails:
Senior Advisor - https://www.unix.com
# 7  
Old 03-03-2011
Hi Ksrivani:
is that you want?
Code:
while ps | grep "pwctest" > /dev/null
do
     sleep  30m
done
 
echo "The pwctest was quitted" | mail Tech

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find directory is getting files in every 10 mins, if not then when last time file received

Dears, I am looking for a script which will work as a watch directory. I ha directory which keep getting files in every 10 mins and some time delay. I want to monitor if the directory getting the files in every 10 mins if not captured the last received file time and calculate the delay. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies

2. Shell Programming and Scripting

Need logs 5 mins old

I need 5 mins old logs to be dumped into a a new file. The date formats in the two log files are Can you suggect for both formats ? bash-3.2$ uname -a SunOS myserver 5.10 Generic_150400-26 sun4v sparc sun4v ---------- Post updated 05-04-16 at 12:24 AM ---------- Previous update was... (2 Replies)
Discussion started by: mohtashims
2 Replies

3. UNIX for Dummies Questions & Answers

Script to search log file for last 15 mins data

Hi All, I have an issue which I'm trying to understand a way of doing, I have several nodes which contain syslog events which I want to force trigger an email initially (eventually leading to another method of alerting but to start with an email). Basically the syslog file will have hours worth... (6 Replies)
Discussion started by: mutley2202
6 Replies

4. Shell Programming and Scripting

Run Bash Script thrice & then interval for 10 mins.

Hi... I am very new to shell scripting. I have written a script with help of this forum and some googling and it works the way I want it to. Currently this script checks for my SIP trunk registration every 5 seconds, if registration is not available then it reboots my router through telnet... (4 Replies)
Discussion started by: jeetz
4 Replies

5. Shell Programming and Scripting

Script (ksh) to get data in every 30 mins interval for the given date

Hello, Since I m new to shell, I had a hard time to sought out this problem. I have a log file of a utility which tells that batch files are successful with timestamp. Given below is a part of the log file. 2013/03/07 00:13:50 Apache/1.3.29 (Unix) configured -- resuming normal operations... (12 Replies)
Discussion started by: rpm120
12 Replies

6. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

7. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

8. Shell Programming and Scripting

Script which will search for a file for 15 mins

Hi All, I would like to write a script which will search a file say abc.dat in /a/b/data for 15 mins only. If the script finds the file in 15 mins then it will exit will exit sucessfully and if there is no file for 15 mins it will exit and copy the last day file (abc.dat_ddmmyyhhmmss) from... (1 Reply)
Discussion started by: chandancsc
1 Replies

9. Shell Programming and Scripting

automatic execution of script after every 10 mins

Hi All, I have a requirement that a script need to be executed automatically every 10 mins. how is this possible. lots of logs are created as a part of process and the logs need to be moved into a directory. how is this possible ? (1 Reply)
Discussion started by: suresh_kb211
1 Replies

10. UNIX for Dummies Questions & Answers

Script to kill rsh processes running for more than 10 mins

Hi Friends, I need to write a script to kill some processes running for more than 10 minutes. Can I get some pointers on that. Thanks for ur help in Advance. Thanks&Regards, Amit (3 Replies)
Discussion started by: amitsayshii
3 Replies
Login or Register to Ask a Question