Find all locked files


 
Thread Tools Search this Thread
Operating Systems AIX Find all locked files
# 1  
Old 09-15-2011
Find all locked files

How to can find all locked files and release the locks in Unix?
We have an issue were an ftp job lands files under /home/loginid at 5:30 pm and at 6 pm we run a get file on the mvs mainframe machine ftp the file from the server to the mainframe. We get an error file is in use eventhu it is not !! However if we wait until next day morning the it works fine !!! Thanks
# 2  
Old 09-16-2011
Well, fuser tells you if anyone else has it open. Not sure anyone has a lock scanner. The fcntl() call can ask if a lock is possible, so it can detect locks, but does not actually display locks. Ditto for lockf() F_TEST. I guess you could write an app to stat a file name from the command line and fcntl f_GETLK the whole file for either read or write per command line options.

Last edited by DGPickett; 09-16-2011 at 11:30 AM..
# 3  
Old 09-16-2011
Another possibility is that the ftp process has not completed by 6pm. The new file will show up in an 'ls' listing as soon as it is opened for writing, unlike MS operating systems where it does not show until the file is closed.
# 4  
Old 09-16-2011
Yes, fuser is good for making sure transfers are complete, but better is that the other end send to a temp name, and if it transfers OK, renames it to the delivery name. A transfer processs may exit for a connection loss in mid-file. Trailers are nice, too, or XML completeness of outer element. Adding an ack/flag file is also effective, but seems a bit crude.
# 5  
Old 09-16-2011
lol
Quote:
Adding an ack/flag file is also effective, but seems a bit crude.
I use that technique, but put the size of the main file as the contents of the flag file. Not all files conveniently have identifiable trailer records.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies

2. Proxy Server

Samba kill the locked files from a useraccount by multiple smbd pids

Details Samba server: Release: 5.10 Kernel architecture: sun4u Application architecture: sparc Hardware provider: Sun_Microsystems Kernel version: SunOS 5.10 Generic_142909-17 Samba version: Samba version 3.5.6 Smb.conf file section Global: # smb.conf for Airbus Industries fuer... (0 Replies)
Discussion started by: Jean-Guillaume
0 Replies

3. UNIX for Dummies Questions & Answers

find Search - Find files not matching a pattern

Hello all, this is my first and probably not my last question around here. I do hope you can help or at least point me in the right direction. My question is as follows, I need to find files and possible folders which are not owner = AAA group = BBB with a said location and all sub folders ... (7 Replies)
Discussion started by: kilobyter
7 Replies

4. Shell Programming and Scripting

what is the find to command to find the files created last 30 days

what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies

5. UNIX for Advanced & Expert Users

How to find locked processors

Hi all, i have no of processors .in that some processors locked. how to find the particular locked processors into list of all the processors. i hav no of processors like ex: processors 1021 1022 1023 1024 1025 ---it is locked 1026 -- - - - - -- 2334334 so i don't know 1025 is... (1 Reply)
Discussion started by: venkatreddy
1 Replies

6. UNIX for Dummies Questions & Answers

I have files that are locked up...

Here's the story: I had an LaCie Internet Space (1TB)... Recently the network (or software) functions of the device just died... I tried to access it via different routers, checking UTP, tried everything possible to rule out physical damage to components. Then i got the disk out of its... (2 Replies)
Discussion started by: SentinelX
2 Replies

7. UNIX for Dummies Questions & Answers

find locked files, print file path, unlock file

using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked how can I do this? I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like. Thanks! (0 Replies)
Discussion started by: alternapop
0 Replies

8. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

9. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies

10. UNIX for Dummies Questions & Answers

deleting locked files

I have some locked files ( locked via the Mac finder) I have tired rm -R and rm -rdf but it doesnt delete the locked files just says "override rw------- etc?" type "yes" and says "operation not permitted" is there some way to do this (or unlock the files) Thanks (1 Reply)
Discussion started by: Aussie John
1 Replies
Login or Register to Ask a Question