01-03-2013
So any way to avoid it hitting files with readlock on it?
There should be some way to successfully search the entire filesystem for a string.
Thanks Again
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all ( again )
I will like to search and replace string in text file
ok I can loop throw the files like :
foreach f ( ` find . -name "*."`)
.. but here I like to examine the file if in contain the desired string
and so do the sed -e 's/blah/foo/g' thingy on it or there is better way... (1 Reply)
Discussion started by: umen
1 Replies
2. UNIX for Advanced & Expert Users
Hi,
In order to have a sand box machine that I could use to test some system changes before going to production state, I'd like to duplicate a working system to a virtual one. Ideally, I'd like to manage to do it this way :
- Make a full system backup excluding the user file system (this... (7 Replies)
Discussion started by: pagaille
7 Replies
3. UNIX for Dummies Questions & Answers
Could someone help me in recursive search and ftp'ing the files to remote server?
The host machine will have
/dir1/dira/list_of_files1
/dir1/dirb/list_of_files2
/dir1/dirc/list_of_files3
.
.
.
so., I need to search from dir1 recursively (only one level down) and find all the files that... (1 Reply)
Discussion started by: brahmi
1 Replies
4. UNIX for Advanced & Expert Users
Hi all,
Since my gopher server doesn't like filenames containing 2 or more consecutive dots in a filename, I'd like to do a search for them and replace them with... well, let's say underscores...
I've tried a oneliner or 2 from other posts, but they don't seem to work well with locating dots.... (3 Replies)
Discussion started by: Evert
3 Replies
5. Shell Programming and Scripting
Hello again.
Well, I need help again sooner as I thought. Now I want to search for files with a known name within all subdirs, and copy the to differently named files in the same directory.
For example if I had only one file to copy, I would just usecp fileName newFileNamebut to do this... (1 Reply)
Discussion started by: cabaciucia
1 Replies
6. Shell Programming and Scripting
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies
7. Shell Programming and Scripting
Hi,
Need some help...
I want to execute sequence commands, like below
test1.sh
test2.sh
...etc
test1.sh file will generate log file, we need to search for 'complete' string on test1.sh file, once that condition success and then it should go to test2.sh file, each .sh scripts will take... (5 Replies)
Discussion started by: rkrish123
5 Replies
8. Shell Programming and Scripting
Dear Unix Forum Group Members,
Please do let me know how I can replace the double pipe with single pipe recursively on single record.
Sample Input Data:
DN set|Call prefix||| Called number address nature
0||| *789|||||||ALL number types
0||| 00||||||||ALL number types
10||... (5 Replies)
Discussion started by: srinu.kadem
5 Replies
9. OS X (Apple)
before posting, I have tried to find my answer elsewhere. no luck.
I need to find a file buried in a folder somewhere.
Master folder has 10 sub folders.
each sub folder has folders too.
I found this but it does nothing
I am on Mac and use Applescript.
do shell script "find... (2 Replies)
Discussion started by: sbrady
2 Replies
LEARN ABOUT DEBIAN
apache::session::lock::file
Apache::Session::Lock::File(3pm) User Contributed Perl Documentation Apache::Session::Lock::File(3pm)
NAME
Apache::Session::Lock::File - Provides mutual exclusion using flock
SYNOPSIS
use Apache::Session::Lock::File;
my $locker = new Apache::Session::Lock::File;
$locker->acquire_read_lock($ref);
$locker->acquire_write_lock($ref);
$locker->release_read_lock($ref);
$locker->release_write_lock($ref);
$locker->release_all_locks($ref);
$locker->clean($dir, $age);
DESCRIPTION
Apache::Session::Lock::File fulfills the locking interface of Apache::Session. Mutual exclusion is achieved through the use of temporary
files and the "flock" function.
CONFIGURATION
The module must know where to create its temporary files. You must pass an argument in the usual Apache::Session style. The name of the
argument is LockDirectory and its value is the path where you want the lockfiles created. Example:
tie %s, 'Apache::Session::Blah', $id, {LockDirectory => '/var/lock/sessions'}
If you do not supply this argument, temporary files will be created in /tmp.
NOTES
clean
This module does not unlink temporary files, because it interferes with proper locking. This can cause problems on certain systems (Linux)
whose file systems (ext2) do not perform well with lots of files in one directory. To prevent this you should use a script to clean out
old files from your lock directory. The meaning of old is left as a policy decision for the implementor, but a method is provided for
implementing that policy. You can use the "clean" method of this module to remove files unmodified in the last $age seconds. Example:
my $l = new Apache::Session::Lock::File;
$l->clean('/var/lock/sessions', 3600) #remove files older than 1 hour
acquire_read_lock
Will do nothing if write lock is in effect, only set readlock flag to true.
release_read_lock
Will do nothing if write lock is in effect, only set readlock flag to false.
Win32 and Cygwin
Windows cannot escalate lock, so all locks will be exclusive.
release_read_lock not supported - it is not used by Apache::Session.
When deleting files, they are not locked (Win32 only).
AUTHOR
This module was written by Jeffrey William Baker <jwbaker@acm.org>.
SEE ALSO
Apache::Session
perl v5.10.1 2010-10-18 Apache::Session::Lock::File(3pm)