Sponsored Content
Top Forums Shell Programming and Scripting Sign on/Sign off logging script Post 302096951 by Andrek on Monday 20th of November 2006 08:41:47 PM
Old 11-20-2006
I guess the easiset way is to create a "lock file"

ie
The first thing you do is check to see if a "lockfile" exist, if not, then it must be the first time and you touch a filesomewhere.....ie create the lockfile

continue process the rest of the script

The last thing the script does before it ends is remove the lock file.

That way if it starts up again....it won't do any thing...because the previous execution created a lock file and is still open at that time....

does that make sense?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Meaning of % sign

Does % sign have any impact, special meaning in unix shell scripts ??? (2 Replies)
Discussion started by: sokash
2 Replies

2. UNIX for Dummies Questions & Answers

(+ sign) Unexpected arithmetic expr script interpretation

I have created the following script to add 2 numbers together : lazyadd2 script : #!/bin/bash #I have added the she-bang script above as I felt that this would be a good idea. #The script takes in 2 arguments that are added together num3=`expr $num1 + $num2` echo $num3 I make the... (9 Replies)
Discussion started by: Birdi6022
9 Replies

3. UNIX for Dummies Questions & Answers

minus sign

why a minus sign is put for options in unix commands suggestions plz (2 Replies)
Discussion started by: trichyselva
2 Replies

4. UNIX for Dummies Questions & Answers

@ sign in permissions?

I am using Mac OS X version 10.5.7, and had a problem accessing a folder on our shared area network. I logged in via terminal (bash shell), and did a ls -l on the main directory, and the directory that isn't showing up has an @ sign at the end: rwxr-xr-x@ 19 admin staff 2048 Jun 1 07:53... (1 Reply)
Discussion started by: aaronstella
1 Replies

5. Shell Programming and Scripting

Count value between | sign

Hi I have a file inw which values are seperated by "|" I want to count number of values present in each line of the file Input file AS|23 34|BD|A2|890 AK|23 44|D|A2|89076|89 AF|23 34|BD|A2|8 Result 5 6 5 there are 5 values inside | sign hence o/p will be 5 similarly in... (2 Replies)
Discussion started by: aaysa123
2 Replies

6. Shell Programming and Scripting

Using grep $ sign help?

hi so I was debugging some scripts and I ran into a problem that did not come up before grep -n "$variable"$ ./file.txt I figured the second $ is meant to reference the end of the line but this gave me trouble in my c shell. anyone know whats wrong here or how to rewrite this??? Thank... (2 Replies)
Discussion started by: vas28r13
2 Replies

7. Shell Programming and Scripting

SSH Script is sticking, & sign not doing what I would expect

I am having an issue where I am do an SSH to about 30 servers one at a time however my script is getting hung up sometimes on the SSH. I thought the & at the end as seen below would fire it and move on but that does not seem to be working. #!/bin/s for remsys in trumpetsnail angel delphin... (3 Replies)
Discussion started by: LRoberts
3 Replies

8. Shell Programming and Scripting

Script to replace last instance of . between two consecutive = sign by ,

Suppose you have a line like this: cn=user.blr.ou=blr.india.o=company The line should be converted like this: cn=user.blr,ou=blr.india,o=comapny Was wondering how to do that using shell script. Please use tags where appropriate, thank you (4 Replies)
Discussion started by: saurabhkoar
4 Replies

9. Forum Support Area for Unregistered Users & Account Problems

Unable to sign in

I am unable to sign in to the UNIX forum. I tried my username "timotei2" and the password - but access was denied. My email address - <removed> - was not recognised, either. This is strange as I registered some years back. Should I re-register, or can nyou re-set my log in credentials? (1 Reply)
Discussion started by: Unregistered
1 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Sign in issues

I tried logging in under my username (Michael Mullig) but as it's been a while I've forgotten my password. None of my email addresses are recognized either. Thinking that my username my have been purged due to lack of activity (understandable) I tried to re-register, only to find the name is still... (2 Replies)
Discussion started by: Mike Mullig
2 Replies
RLOCK(1)						      General Commands Manual							  RLOCK(1)

NAME
rlock - run program with a lockfile SYNOPSIS
rlock [options] lockfile program [args] rlock [options] lockfile -- program options [args] DESCRIPTION
rlock creates NFS safe lockfiles. it can optionally run a program while holding the lock, ensuring lockfile removal on program exit. if a program is specified to be run rlock will spawn a background thread to kept the lockfile 'fresh' by touching it at a regular interval. in this way a lease is maintained on the lockfile and other processes attempting to obtain the lock can determine that it is in use. see the '--refresh' option for how to control the touch interval. any other process trying to obtain a lock will automatically remove a stale lockfile; a stale lockfile is one that is older than a certain age. this age be controled via the '--max_age' option. ENVIRONMENT
LOCKFILE_DEBUG=1 causes internal actions of the library to be shown on STDERR. DIAGNOSTICS
rlock attempts to exit with the status of 'program' except where it cannot due to exceptional conditions. in addition the message 'RLOCK SUBCOMMAND FAILURE' will be printed on STDERR if 'program' exits with non-zero status. AUTHOR
lockfile was written by Ara T. Howard <ara.t.howard@noaa.gov>. This manual page was converted by Decklin Foster <decklin@red-bean.com> for the Debian project (but may be used by others). 2008-10-11 RLOCK(1)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy