Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Script should keep running only at specific time Post 303045237 by Syedsabeel on Saturday 14th of March 2020 07:34:40 AM
Old 03-14-2020
My current .sh file below. Which need to run only once and it will do its job. I need below script to run only at 6am to 00.

Code:
#!/bin/bash

BM_HOME=/home/jsoc

BM_LIB=$BM_HOME/lib/BulkTerminationLib/
BM_PROPS=$BM_HOME/properties/
BM_LOG_PATH=$BM_HOME/logs
BM_PROPS_FILE=$BM_HOME/properties/bulktermination.properties
BM_log4j_FILE=$BM_HOME/properties/bulkterminationlog4j.properties

CLASSPATH=BulkTermination:$BM_LIB/BulkTermination.jar:$BM_LIB/log4j-1.2.15.jar:$BM_LIB/com.mysql.jdbc_5.1.5.jar:$BM_LIB/http-core-4.1.jar:$BM_LIB/httpclient-4.0.3.jar:$BM_LIB/org.apache.commons.httpclient.jar:$BM_LIB/org-apache-commons-logging.jar

echo $CLASSPATH

########################################################################################################################################

java  -cp $CLASSPATH -DTPP_PROPS=$BM_PROPS_FILE -DTPP_log4j=$BM_log4j_FILE com.sap.term.main.BulkTermination 1>>$BM_LOG_PATH/BulkTermination.log 2>>$BM_LOG_PATH/BulkTerminationError.log &


Last edited by vbe; 03-14-2020 at 09:27 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ending script at specific time.

Hello Everybody.. I've written the script that kick off through CRON job and kill itself by specific time. I've start time and end time specify in env file. i.e START_TIME=1500 (03:00 PM) END_TIME=0600 (06:00 AM) It always works good if my START_TIME is before midnight and my... (4 Replies)
Discussion started by: nirav_soni
4 Replies

2. Shell Programming and Scripting

Running batches of files at a time from a script

Hi I have a script that performs a process on a file. I want to know how to include a function to run a batch of files? Here is my script #!/bin/bash #---------------------------------------------------------------------------------------------------------------------- #This... (2 Replies)
Discussion started by: ladyAnne
2 Replies

3. Emergency UNIX and Linux Support

Help to optimize script running time

Dear Forum experts I have the below script which I made to run under bash shell, it runs perfectly for low records number, let us say like 100000. when I put all records (3,000,000), it's takes hours can you please suggest anything to optimize or to run in different way :-| {OFS="|";... (6 Replies)
Discussion started by: yahyaaa
6 Replies

4. Shell Programming and Scripting

Help in running a script after a particular time

Unix Gurus, I have a requirement where the shell script needs to do specific tasks after certain period of time. Daily we receive few files in a particular folder. The script does the file renaming, pass parameters to run some web services and pushes to remote FTP location. But my... (3 Replies)
Discussion started by: shankar1dada
3 Replies

5. Shell Programming and Scripting

How to know the exact running time of script!

Hi All, newbie here, I'm just wondering how can i know the exact running time of my script? Please advise, THanks, (1 Reply)
Discussion started by: nikki1200
1 Replies

6. Shell Programming and Scripting

script for get lines with specific time.

i want to make a script for grep any lines with key word and every time (5 min) Ex. Log in Server. . . . 03-01-2012 03:07:54,924 - INFO MessageUtil - Return | Status=0 | TxID=12010300000548755292 | Message=Success 03-01-2012 03:09:13,789 - INFO MessageUtil - Return | Status=0 |... (6 Replies)
Discussion started by: ooilinlove
6 Replies

7. Shell Programming and Scripting

Help with kill a specific process after certain running time

Hi, Do anybody experience to write a bash script in order to kill a specific process (java) after certain time of running? eg. java java.jar task_run.txt I will run a java program (java.jar) which will run a long list of process (task_run.txt) one by one. I plan to terminate the java... (5 Replies)
Discussion started by: perl_beginner
5 Replies

8. Shell Programming and Scripting

Setting time for running of the script

Dear all, I wonder if it is possible that we can run the script from time to time..I meant, it should repeat the sourcing of the script by itself? In my case, I need to source this script manually from time to time, like once in every 10 minutes. emily, (2 Replies)
Discussion started by: emily
2 Replies

9. Shell Programming and Scripting

Example of running script with time limits?

Hi, I want to write a script that does some sort of health check on the database. It will query the database for information, some query takes long and some are quick. For example, inside the script I will do something as below: #!/bin/ksh run_query_01 & run_query_02 &... (1 Reply)
Discussion started by: newbie_01
1 Replies

10. Shell Programming and Scripting

Running script in crontab in a specific directory

I am trying to run a script from crontab but the entire script (which is 70+ lines) is written in bash and I need it to run from a certain directory. So when I run it manually I cd to /local/mnt/scr and then type ./reordersc and it works fine. However, I want it to run from the crontab and I... (20 Replies)
Discussion started by: newbie2010
20 Replies
SCOUT(1)						    http://en.opensuse.org/Sco							  SCOUT(1)

NAME
scout - A Package Scout SYNOPSIS
scout [global_options] {module} {search_term} [module_options] OPTIONS
The following options are available: global_options, module The global options are handled by scout itself. --format Specify the default output format. Choices are table (default), xml, csv. It's a replacement of the older scoutcsv, scoutxml links. --help Print a brief help. --version Print version. The respective module to search for. The following modules are available: autoconf Search for autoconf macros inside m4 files. bin Search for binaries contained in packages. header Search for C/C++/Obj-C/Obj-C++ headers java Search for Java classes inside packaged JAR files. python Search for Python modules. webpin Search in packages using the Webpin webservice. search_term The term you are looking for. module_options Additional module options. At the moment these are: --listrepos list all available repositories --repos=REPO, -r REPO select a repository to search (use a name from the --listrepos output) DESCRIPTION
Scout is a tool to look for uninstalled packages. For example, which binary does a package provide, which Java classes are available and which autoconf macros does a package contain. To search for your requested term, you need index data files which are a preconfigured SQLite 3 database. You have to install these in order to get your search request done. Use the Scout OBS data repository[1] to get additional index files. See the Wiki page about Scout[2] for more information. EXAMPLE 1: SEARCH FOR EXECUTABLES For example, to search for a sdl-config executable, you need the bin module: $ scout bin sdl-config You get the following output: repository | binary | path | package ------------+------------+-----------------------------+----------------- suse110 | sdl-config | /usr/bin | SDL-devel suse110 | sdl-config | /usr/lib/baselibs-32bit/bin | SDL-devel-32bit EXAMPLE 2: SEARCH FOR JAVA PACKAGES If you want to search for a Java package, use the following code: $ scout java org.apache.xml.serialize.Serializer You get: repository | package | jar | class ------------+------------------+---------------------+------------------------------------------------ jpackage17 | jboss4-testsuite | xerces.jar | org.apache.xml.serialize.Serializer jpackage17 | jboss4-testsuite | xerces.jar | org.apache.xml.serialize.SerializerFactory jpackage17 | jboss4-testsuite | xerces.jar | org.apache.xml.serialize.SerializerFactoryImpl jpackage17 | xerces-j2 | xerces-j2-2.9.0.jar | org.apache.xml.serialize.Serializer jpackage17 | xerces-j2 | xerces-j2-2.9.0.jar | org.apache.xml.serialize.SerializerFactory jpackage17 | xerces-j2 | xerces-j2-2.9.0.jar | org.apache.xml.serialize.SerializerFactoryImpl EXAMPLE 3: SEARCH THROUGH WEBPIN If you want to use the openSUSE Search Webservice[3]--also known as "Webpin"--use the following line: $ scout webpin docbook_5.xml You get: package | version | arch | repository URL | matched files -----------+---------+--------+-----------------------------------------------------------------------------------+------------------------ docbook_5 | 5.0 | noarch | http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse | /etc/xml/docbook_5.xml docbook_5 | 5.0CR7 | noarch | http://download.opensuse.org/repositories/home:/thomas-schraitle/openSUSE_Factory | /etc/xml/docbook_5.xml docbook_5 | 5.0 | noarch | http://download.opensuse.org/repositories/XML/xml-factory | /etc/xml/docbook_5.xml BASH COMPLETION
If you like to complete your options automatically through Bash, insert the following lines into your ~/.bashrc or /etc/bash.bashrc: if [ -f /etc/bash_completion.d/scout.sh ]; then . /etc/bash_completion.d/scout.sh fi SEE ALSO
command-not-found(1) AUTHORS
Pavol Rusnak <stick@gk2.sk> Developer Michal Vyskocil <mvyskocil@suse.cz> Developer Ales Nosek <anosek@suse.cz> Index data for Java Pascal Bleser <guru@unixtech.be> Webpin code Marek Stopka <mstopka@opensuse.org> Bash completion Thomas Schraitle <toms@suse.de> Docbook documentation Klaus Kaempf <kkaempf@suse.de> Help with python-satsolver NOTES
1. Scout OBS data repository http://download.opensuse.org/repositories/home:/prusnak:/scout/data 2. Wiki page about Scout http://en.opensuse.org/Scout 3. openSUSE Search Webservice http://software.opensuse.org/search http://gitorious.org/opensus 08/07/2009 SCOUT(1)
All times are GMT -4. The time now is 09:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy