Sponsored Content
Top Forums Shell Programming and Scripting How to run multiple instances of shell script in linux? Post 302631449 by anuragpgtgerman on Friday 27th of April 2012 10:40:29 AM
Old 04-27-2012
How to run multiple instances of shell script in linux?

How we can run the multiple instances of the script? I need to run the script which I am calling from the below function.I can doit with cron but I don't want to put it in the cron.This cript dploy the build and here I want when the build stage then it should run with multilpe instances of colodeolpyall script where it finds the new.txt file ..
Code:
/mnt/projects/stp2perf2_app_runtime/lamb/current.txt
/mnt/projects/stp2perf2_app_runtime/orbitgw/current.txt
/mnt/projects/stp2perf2_app_runtime/stp/wsHUB/current.txt
/mnt/projects/stp2perf2_app_runtime/stp/wsSTP/current.txt
/mnt/projects/stp2perf2_app_runtime/stpbatch/current.txt
/mnt/projects/stp2perf2_app_runtime/stpmon/current.txt
/mnt/projects/stp2perf2_app_runtime/stpscripts/current.txt
/mnt/projects/stp2perf2_app_runtime/stptools/current.txt
/mnt/projects/stp2perf2_app_runtime/tag/current.txt
[stp@VHLDVW stp]$ find /mnt/projects/stp2perf2_web_runtime/* -maxdepth 2 -name current.txt -type f
/mnt/projects/stp2perf2_web_runtime/gdesksrv/current.txt
/mnt/projects/stp2perf2_web_runtime/gdesksrv_lgcy/current.txt
/mnt/projects/stp2perf2_web_runtime/gdesksrv_ungt/current.txt
/mnt/projects/stp2perf2_web_runtime/npg/current.txt
/mnt/projects/stp2perf2_web_runtime/stp/gwSTP/current.txt
/mnt/projects/stp2perf2_web_runtime/stpinbound/current.txt
/mnt/projects/stp2perf2_web_runtime/stpproxy/current.txt
/mnt/projects/stp2perf2_web_runtime/stpscripts/current.txt
/mnt/projects/stp2perf2_web_runtime/stptools/current.txt
/mnt/projects/stp2perf2_web_runtime/stpweb/current.txt

Code:
calldeploy()
   {
   cd /projects/stp/stpbuild/logs/BuildLogs/
   #Type=`grep "Build Type:" < ${LogFile} | awk -F"." '{print $NF}'`
   Type=`cat ${LogFile} | grep -o "Stage" | uniq`
   Pass=`grep "Result:" < ${LogFile} | awk -F"." '{print $NF}'`
   if [[ ${Type} == "Stage" && ${Pass} == "SUCCESSFUL" ]];then
   ssh -l stpuser VHLDVWSAD001 /projects/stp/stputils/deploy/colodeployall.sh &
   fi
   }
   calldeploy

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

reg no of instances of a script run using cron

I have the below code in a file called test.ksh and it is scheduled using cron forevery 5 min. when i see the cron out file for every 5 min it showing the no of process running are 2. same thing when i implement in another script which contains other code along with the below code , it showing as... (1 Reply)
Discussion started by: kamesh83
1 Replies

2. Filesystems, Disks and Memory

script to create multiple instances of a user account across LPAR's

My company has about 40 databases with each database in a different logical partition. Presently the SysAdmin person says it is necessary to create a user profile (login and password for each instance of databases on each LPAR. 1. Is it necessary that the user must be created in each LPAR? 2.... (1 Reply)
Discussion started by: kcampbell
1 Replies

3. Shell Programming and Scripting

Multiple instances of the job in shell script.

Hi, Please let us know how to create a multiple instances of a job in the shell script. Thanks. Gangegowda K.G (1 Reply)
Discussion started by: Gangegowda
1 Replies

4. Shell Programming and Scripting

Multiple Threads/Tasks to run parallely using the shell script

Scenario: I have two PCs (named as A & B) which would send some traps to my third PC (named as C). In PC C, I have to write a shell script such that it should accept the datas from both the PC-A & B parallely. So my question is, is it possible to have two different child threads/tasks... (2 Replies)
Discussion started by: nthiruvenkatam
2 Replies

5. Shell Programming and Scripting

Want to have delay in multiple instances of the same shell script

Hello, My goal is to run the same Shell script in a parallel mode. This script will get triggered from different machines and different application teams by some job scheduling tool. They may trigger the process at the same time. so I want to have them in QUEUE ..and release them for execution on... (3 Replies)
Discussion started by: chetan_sonar
3 Replies

6. Shell Programming and Scripting

Shell script to run a python program on multiple entries in a file

Hello I am trying to run a python program using shell script, which takes a single argument from a file. This file has one entry per line : 1aaa 2bbb 3ccc 4ddd 5eee ... ... ... My shell script runs the program, only for the last entry : #!/bin/sh IFS=$'\n' for line in $(cat... (2 Replies)
Discussion started by: ad23
2 Replies

7. Shell Programming and Scripting

run vi/vim encrypted shell script without decryption on multiple servers

Hello Everyone, How do we run vi/vim encrypted shell script without decryption on multiple servers. It is a simple bash script and vim -nx <filename> has been used to encrypt with desired password. Now I have few errors, the syntax is absolutely fine as I have run that script multiple times on... (0 Replies)
Discussion started by: lovesaikrishna
0 Replies

8. Shell Programming and Scripting

Run different SQL on multiple DBs using SHELL script

Hi Experts, I have a list of Dbs.In that DBs i need to execute some sql scripts. each sql script is unique and it should run on particular DB only. For example. i have DBs like MDC20V,NDC20V,ODC20V and sql scripts like MD.sql,ND.sql,OD.sql.so MD.sql should run only in MDC20V and ND.sql should... (1 Reply)
Discussion started by: navsan420
1 Replies

9. Shell Programming and Scripting

Run multiple procedures from shell script parallely

Hi, I need to write a Shell Script wherein i will connect to a DB2 Database and run multiple DB procedures. I know how to do in a way where procedures will be called one after the other, like when first procedure finishes, second will be executed. But what i want is to run them at the same time... (11 Replies)
Discussion started by: Neelkanth
11 Replies

10. Shell Programming and Scripting

Script to Run Multiple Systems Checks and mail me the results after every reboot- Linux

Hello, I'm trying to create a mechanism wherein a set of Production servers will email me the results of system checks like Uptime, NFS Mounts and a Process after every scheduled reboot. For this, I figured I'd use the @reboot parameter that crond comes with. I have added the below onliner... (3 Replies)
Discussion started by: pocodot
3 Replies
projects(1)							   User Commands						       projects(1)

NAME
projects - print project membership of user SYNOPSIS
projects [-dv] [ user] projects -l [projectname [projectname...]] DESCRIPTION
The projects command prints on standard output the projects to which the invoking user or an optionally specified user belongs. Each user belongs to some set of projects specified in the project(4) file and possibly in the associated NIS maps and LDAP databases for project information. OPTIONS
The following options are supported: -d Prints only default project. -l Prints verbose info on each project projectname. If no projectnames are given, info on all projects is printed. -v Prints project descriptions along with project names. OPERANDS
The following operand is supported: projectnaDisplay information for the specified project. user Displays project memberships for the specified user. EXAMPLES
Example 1: Displaying Membership for a Specified User example$ projects paul default beatles wings example$ projects ringo default beatles example$ projects -d paul beatles EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 A fatal error occurred during execution. 2 Invalid command line options were specified. FILES
/etc/project Local database containing valid project definitions for this machine. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Stability |See below. | +-----------------------------+-----------------------------+ The invocation is Evolving. The human-readable output is Unstable. SEE ALSO
getdefaultproj(3PROJECT), getprojent(3PROJECT), project(4), attributes(5) SunOS 5.10 13 May 2004 projects(1)
All times are GMT -4. The time now is 05:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy