Sponsored Content
Top Forums UNIX for Advanced & Expert Users Last touched file by a specific program ? Post 302926310 by bartus11 on Sunday 23rd of November 2014 06:45:50 AM
Old 11-23-2014
Create a new file in that directory, that will be used as a lock file. Use flock - perldoc.perl.org on that lock file in all three scripts. Use that lock file to store information about which script executed last in this directory.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Which Base Level Filesets needed by a specific program?

hello... thats a great forum btw :) my problem is that I need a list of the Base Level Filesets (BLF) which are needed by a specific program. Is there any command/tool which shows me that? during the installation I can choose "Preview only" so that I can see what BLF´s are missing etc but... (4 Replies)
Discussion started by: cypher82
4 Replies

2. UNIX for Dummies Questions & Answers

comparing timestamp of a file with its touched version

Hi, I'm new to unix,I wanna know how can I compare timestamp of a file with its touched version.i.e I want to be sure if the touch command has worked properly i.e if the file has been touched then a msg should be printed saying success else failure.All this to be incurred in a script. Any... (2 Replies)
Discussion started by: prince258
2 Replies

3. UNIX for Advanced & Expert Users

Checking mem usage at specific times in a program

Hi all, I'm running a simulator and I'm noticing an slow increase in memory for long simulations such that the simulation has to end because of a lack of memory. A colleague of mine ran Valgrind memcheck and reported that nothing of interest was reported other than known mem leaks. My advisor... (2 Replies)
Discussion started by: pl4u
2 Replies

4. What is on Your Mind?

Finally I touched 1000.Yahooooo!!!

This, my venerable audience, is my 1000th post here. Thanks for your support and help..:b: ---Vidyadhar:) (4 Replies)
Discussion started by: vidyadhar85
4 Replies

5. UNIX for Dummies Questions & Answers

Never touched UNIX before.. Where do I start?

I will be taking a UNIX course as a part of my college Data Com concentration curriculum. Just thought it would be a good idea to get a little head start, since this class will most likely be quite difficult for someone like me. I never did any programming and I never dealt with Unix or Linux short... (3 Replies)
Discussion started by: ibex333
3 Replies

6. AIX

how to find which program that update a specific file

Hello Would you tell me how to find which program that update a specific file? I am implementing migration project. My machines OS are AIX. It is because lack of documentation, some program cannot working properly on new machine. We found the root cause of this problem is that some data... (4 Replies)
Discussion started by: cstsang
4 Replies

7. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies

8. Shell Programming and Scripting

Program to search for the files with specific format

Hi All, Your help on the below requirement is highly appreciated. I am building a program which should pick the file from a source directory and place them into target directory. While selecting the file in source it should look for some pattern in the file name. Ex: File Name 1:... (10 Replies)
Discussion started by: bharath561989
10 Replies

9. Shell Programming and Scripting

Running program and output files in specific directories

I have been running a program mseed2sac using the following command cd IV find . -type f -exec /swadmin/mseed2sac '{}' \; The problem is that I end up with a lot of files in directory IV. Instead I would like to select the designator HHZ, create a directory IV.SAC and all the files output... (11 Replies)
Discussion started by: kristinu
11 Replies

10. UNIX for Beginners Questions & Answers

Seraching for a specific program

I know that Qt exists on this IMX6+ the device has Linux 4.9.184 embedded. I need to figure out which version of Qt it has. What is the best way to find a program given only a text based terminal? Is there a way I can grep for it? (2 Replies)
Discussion started by: Circuits
2 Replies
FLOCK(1)						    BSD General Commands Manual 						  FLOCK(1)

NAME
flock -- Provide locking API for shell scripts SYNOPSIS
flock [-dnosvx] [-w timeout] lockfile|lockdir [-c command] | [command ...] flock [-dnsuvx] [-w timeout] lockfd DESCRIPTION
The flock utility provides flock(2) access to the command line or scripts. The first form locks a file or directory while the command pro- vided is executed. If the file or directory does not exist, then a file is created. The second form can use an arbitrary file descriptor that is provided from a shell script for example: ( flock -s 100 # commands to be executed under the lock ) 100> /path/to/lockfile The following options are available: -c command Pass a command to a the shell. -d, --debug Provide debugging output. -n, --nb, --nonblock Don't block and fail immediately if the lock could not be obtained. -o, --close Close the file before executing the command. This is useful if the child forks and should not be holding the lock. -s, --shared Obtain a shared lock. -u, --unlock Unlock an existing lock. This is available only for a file descriptor. -v, --verbose On error print an explanation of the failure. -w, --wait, --timeout seconds Fail if the lock could not be obtained after seconds. -x, --exclusive Obtain an exclusive lock. EXIT STATUS
The flock utility exits 0 on success, and >0 if an error occurs. SEE ALSO
shlock(1), flock(2) HISTORY
An flock utility appeared in NetBSD 6.1. BSD
November 2, 2012 BSD
All times are GMT -4. The time now is 06:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy