Sponsored Content
Top Forums Shell Programming and Scripting No lock file: Preventing multiple instance of a script Post 302574683 by pludi on Friday 18th of November 2011 03:24:58 AM
Old 11-18-2011
Different idea: save the PID of the script in the lock file. If the script is started again, check if that PID is still existing, and in an instance of the script, and stop or run accordingly.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiple instance of same process

;)Hi Everyone, I am using solaris 5.10. I have a java process running in server mode in unix. The problem is that it automatically forks i.e creates a child process. I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (0 Replies)
Discussion started by: glamo_2312
0 Replies

2. UNIX for Advanced & Expert Users

Multiple Instance Of Same Process

Hi Everyone, I am using solaris 5.10. I have a java process running in server mode in unix. The problem is that it automatically forks i.e creates a child process. I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (5 Replies)
Discussion started by: glamo_2312
5 Replies

3. Shell Programming and Scripting

Help with multiple instance script checking

I am trying to debug the following script. It appears that when the check for script running occurs, it's finding the actual grep statement and causing the script believe the script is already running. This is deployed on two different servers where one works fine, the other doesn't. Any ideas? ... (2 Replies)
Discussion started by: DaddyMoose
2 Replies

4. UNIX for Advanced & Expert Users

Multiple Instance of Unix Shell Script

Hi All, I have a problem mentioned below. I have a script which performs line by line operations on several files. I have a temp_file storing the list of names of the file to be validated. Right not in while loop i validate these files one by one. Is there anyway that i can modify... (1 Reply)
Discussion started by: amitaryans
1 Replies

5. Shell Programming and Scripting

A script that spawns multiple instance of itself.

Hi all,I have some questions of forking new process,the code is below.Any help will be appreciated. 1 #! /bin/bash 2 3 PIDS=$(pidof sh $0) 4 P_array=( $PIDS ) 5 echo $PIDS 6 let "instances = ${#P_array}-1" 7 8 echo "$instances instance(s)" of this script running." 9... (4 Replies)
Discussion started by: homeboy
4 Replies

6. Shell Programming and Scripting

Multiple instance in tomcat

I need to install a tomcat6 with multiple instances like instance1,instance2 and instance3 in a server. I came to know that for that we need to install tomcat6,apache2.0,mod_jk1.2 and jre with tools.jar installed.And we need to create multiple instances with same web.xml and difference... (0 Replies)
Discussion started by: tuxslonik
0 Replies

7. Shell Programming and Scripting

script to remove and recreate a lock file

Hi all, i have a small script to remove locks for the prevous day and create new lock for processing in the path on my server i have made something like this #!/bin/sh #lock_remover #script to remove regular lockfiles and hang curr_month=`date "+%b"` 2day=`date "+%_d"` cd... (4 Replies)
Discussion started by: godie_b_w
4 Replies

8. Ubuntu

How to lock a file through UNIX KSH shell script?

I wrote two shell scripts in UNIX that renames the same file and scheduled them at the same time. The following are the steps that I followed:- 1. I wrote 2 scripts named s1.sh and s2.sh, both trying to add “exec_” prefix to the name of the files present in a folder i which already don't start... (4 Replies)
Discussion started by: piuli
4 Replies

9. Shell Programming and Scripting

Script calling multiple scripts (using lock file)

Hi all, i have compiled a script as below. Basically this script is intended to call 3 other scripts, which i intend to run simultaneously. #!/usr/bin/bash HOMEDIR=/path/of/home LOCKDIR=$HOMEDIR/lock #check for LOCK LOCKFILE=$LOCKDIR/$(basename $0 .sh).lock if ; then echo... (2 Replies)
Discussion started by: nms
2 Replies
PERF-LOCK(1)							    perf Manual 						      PERF-LOCK(1)

NAME
perf-lock - Analyze lock events SYNOPSIS
perf lock {record|report|script|info} DESCRIPTION
You can analyze various lock behaviours and statistics with this perf lock command. 'perf lock record <command>' records lock events between start and end <command>. And this command produces the file "perf.data" which contains tracing results of lock events. 'perf lock report' reports statistical data. 'perf lock script' shows raw lock events. 'perf lock info' shows metadata like threads or addresses of lock instances. COMMON OPTIONS
-i, --input=<file> Input file name. (default: perf.data unless stdin is a fifo) -v, --verbose Be more verbose (show symbol address, etc). -D, --dump-raw-trace Dump raw trace in ASCII. REPORT OPTIONS
-k, --key=<value> Sorting key. Possible values: acquired (default), contended, wait_total, wait_max, wait_min. INFO OPTIONS
-t, --threads dump thread list in perf.data -m, --map dump map of lock instances (address:name table) SEE ALSO
perf(1) perf 06/30/2014 PERF-LOCK(1)
All times are GMT -4. The time now is 12:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy