Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need help making a start/stop script... Post 302364789 by phpfreak on Friday 23rd of October 2009 11:06:31 PM
Old 10-24-2009
Need help making a start/stop script...

i have two separate scripts that work nicely to curl and generate two files.. one html and one txt so a total of four.

When the script starts up i want it to:
call and run shellscripta
call and run shellscriptb
sleep for about 40 seconds
again run shellscripta
again run shellscriptb
check and make sure both txta and txtb exist then..
check for any differences..
if they are the same than continue loop/sleep
if the two text files contain different data
email user@somewhere.com with the data of both files then continue loop
--loop stops when i run 'xcommand stop'


There are two parts of this that's difficult for me.. one is creating a loop that starts and stops when i tell it.. the other is the portion that checks for differences then emails.. the script has to 'head -n4' both text files to see if there are any differences.. if there are i need it to 'mail' me both parts of the text files 'head -n5' (5th line containing the date so i know what's oldvsnew).. i hope i'm making some sense but any help would be great
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Start/Stop Script

I'm a newbie to the Unix world Help! I have to maintain a host of Sybase database servers sitting on Unix Sun Solaris 8...I've been tasked with finding/creating a way to auto start/stop Unix via unix commands, specifically when the Unix servers need to be restarted we want Sybase to start... (2 Replies)
Discussion started by: jjv1
2 Replies

2. UNIX for Dummies Questions & Answers

Making a Script to Start as a Service

Hi, I have a shell script t1.sh. on my solaris box. So, what are the steps required to make this script run as a Service, when the system re-starts. (for ex:- at run level 3). I know that I should use the rc.d folders. But I don't know the exact steps. Kindly explain, Thanks in... (3 Replies)
Discussion started by: S.Vishwanath
3 Replies

3. Shell Programming and Scripting

Start Stop Restart

I'm wondering how I should make a script that can start, stop, and restart another script. What I need to be able to do, is start and stop a perl script from the command line. The easiest way of doing this seems to be to have another script, starting and stopping the other script. I have BASH,... (7 Replies)
Discussion started by: Bakes
7 Replies

4. Shell Programming and Scripting

Help with stop/start Shell Script.

Hi All, I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task. 1. User will input the option which server they wish to stop. 2. Will clear cache files from specific location. 3. ... (1 Reply)
Discussion started by: venga
1 Replies

5. UNIX for Dummies Questions & Answers

Why does fibonacci sequence script stop making sense at 92nd iteration?

So, Just for practice, I wrote a simple fibonacci sequence script in bash. (03:08:02\$ cat fib #!/usr/bin/bash ret () { echo -ne "\n" sleep .5 } a=1 b=2 echo -n $a #1 A ret echo -n $b #2 B ret (8 Replies)
Discussion started by: DeCoTwc
8 Replies

6. Solaris

Stop/start script problem on Solaris-10

I have Big brother script, which start/stop Big Brother processes. Something got change on server and now I am not able to start/stop it. There is no change in script, as I compared it from other server. This service is being managed by bb user (group is also bb). root@tsazdq04:/#... (6 Replies)
Discussion started by: solaris_1977
6 Replies

7. Shell Programming and Scripting

Shell Script for Websphere MQ Queue Manager start/stop

Hello All, I am completely new to shell scripting. I had to write a script that starts and stop the queue manager in Websphere MQ. We are on Linux 64-bit patform. The script should stop the queue manager and all the processes related to websphere MQ. It should be a clean stop. Once the queue... (3 Replies)
Discussion started by: pady1224
3 Replies

8. Shell Programming and Scripting

Shell script to stop and start server

Hi, I need to create a shell script for automated server patching, with the following scenario: I have two Linux servers Primary and secondary. Server patching should start on Primary 1st and then secondary. 1st check both servers are up and running. Then stop primary and patching will... (1 Reply)
Discussion started by: rcroyal88
1 Replies
supervise(8)						      System Manager's Manual						      supervise(8)

NAME
supervise - starts and monitors a service. SYNOPSIS
supervise s DESCRIPTION
supervise switches to the directory named s and starts ./run. It restarts ./run if ./run exits. It pauses for a second after starting ./run, so that it does not loop too quickly if ./run exits immediately. If the file s/down exists, supervise does not start ./run immediately. You can use svc(8) to start ./run and to give other commands to supervise. supervise maintains status information in a binary format inside the directory s/supervise, which must be writable to supervise. The sta- tus information can be read by svstat(8). supervise may exit immediately after startup if it cannot find the files it needs in s or if another copy of supervise is already running in s. Once supervise is successfully running, it will not exit unless it is killed or specifically asked to exit. You can use svok(8) to check whether supervise is successfully running. You can use svscan(8) to reliably start a collection of supervise processes. SEE ALSO
svc(8), svok(8), svstat(8), svscanboot(8), svscan(8), readproctitle(8), fghack(8), pgrphack(8), multilog(8), tai64n(8), tai64nlocal(8), setuidgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8) http://cr.yp.to/daemontools.html supervise(8)
All times are GMT -4. The time now is 09:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy