Sponsored Content
Top Forums Shell Programming and Scripting Need opinions about scripting blackouts Post 302370055 by aigles on Tuesday 10th of November 2009 09:03:36 AM
Old 11-10-2009
Something like that :
Code:
BLACKOUT_START=`grep -i "$ORACLE_SID" $INIFILE | cut -d":" -f3`
BLACKOUT_END=`grep -i "$ORACLE_SID" $INIFILE | cut -d":" -f4`
CURRENT_HOUR=`date +%H`

CHECK_BASE=YES
if (( BLACKOUT_START > BLACKOUT_END ))
then
   (( CURRENT_HOUR >= BLACKOUT_START ||  CURRENT_HOUR <= BLACKOUT_END )) && CHECK_BASE=
else
   (( CURRENT_HOUR >= BLACKOUT_START &&  CURRENT_HOUR <= BLACKOUT_END )) && CHECK_BASE=
fi

if [ -n "$CHECK_BASE" ]
then
   : Check database
fi

Jean-Pierre.
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Runaway process. Opinions needed

not too long ago, i wrote a very short script that will bring up 4 customized xterms. The script went completely abnormal simply because of an error I had made in a while loop. This script took control of the system and rendered everything useless. The system admin team which i was part of... (4 Replies)
Discussion started by: TRUEST
4 Replies

2. UNIX for Advanced & Expert Users

Opinions on memory increase

We are trying to tune a server which phsycially is maxed out on cpu. We are maxing out on memory and swapping at a rate of 20-43% of our swap space which is approx 45% of total ram. We "can" upgrade to twice the memory that we currently have but it will be costly as there are no more seats... (5 Replies)
Discussion started by: MizzGail
5 Replies

3. UNIX for Advanced & Expert Users

Opinions on db operating systems Wanted

I am interested in hearing anyones opinions on what OS they would choose to run a MySQl db and the reasons why, of course. I have a task to build a db server for a project that will be very busy if things work as the creative minds think that it will. I am running a FreeBSD box right now on... (0 Replies)
Discussion started by: smtpgeek
0 Replies

4. Shell Programming and Scripting

Opinions/Ideas/Suggestions needed

I'm currently developing a script to clean out certain directories based on age and name. Part of the assignment is to ensure that the cleaning of a directory is done under the user id of the owner (script is running as root). I have a few ideas on how to do this, but I'd like to hear your... (3 Replies)
Discussion started by: pludi
3 Replies

5. UNIX and Linux Applications

opinions on video editors

What is everyones opinions on these video editors? PiTiVi Avidemux Cinelerra Kdenlive Kino Linux Video Editing: Top Five Linux Video Editors (0 Replies)
Discussion started by: cokedude
0 Replies
service(8)						      System Manager's Manual							service(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the invoked script, service passes COMMAND and OPTIONS it to the init script unmodified. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start command. service --status-all runs all init scripts, in alphabetical order, with the status command. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. ENVIRONMENT
LANG, TERM The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton, update-rc.d(8), init(8), invoke-rc.d(8). Jan 2006 service(8)
All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy