Process only files which have completed in transaction


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Process only files which have completed in transaction
# 1  
Old 05-29-2013
Process only files which have completed in transaction

Hi ,


I have a situation where I have to Process files ( move , edit or rename ) in a folder ..... This folder is a FTP folder and Files keep coming in when they are available ... So I should perform my actions on those which which completed transaction .. .



Is there a way to identify a file which is in flight to the folder ? so that i can exclude them from my script ?


Thank you
Arun
# 2  
Old 05-29-2013
fuser ??
# 3  
Old 05-29-2013
Thank you for your reply ....


I am not able to perform the operation with FUSER ..


I got a command lsof but not able to execute it as well .. I use HP unix ... it will be great if i can get a working code to understand. ( i am a beginner )
# 4  
Old 05-29-2013
The fuser command list the processes using a file or file structure.
Code:
man fuser

So if your file is currently in use and open, you should get something like:
Code:
$ /usr/sbin/fuser file
file:    26847o

26847 is the PID and o indicates that the process has file open.

Now you can write a script to run this command and determine if the file can be excluded or not.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Transaction based resources

How do I determine the resources needed based on volume of transactions. By resources I mean, the cores, memory etc. Is there a way to arrive at that value? (1 Reply)
Discussion started by: ggayathri
1 Replies

2. Shell Programming and Scripting

How to stop cronjob automatically after cron process get completed?

Hi , I have scheduled the script using cron between 25-31 of the month. My script will trigger the ETL job once file is available in Windows path between these days(every 2 hours between 26 - 30 of every month ). So my question : "if the ETL job completes cron should stop the running the... (5 Replies)
Discussion started by: Jaganjag
5 Replies

3. Programming

Difference between BEGIN TRANSACTION & START TRANSACTION?

What's the difference between BEGIN TRANSACTION vs START TRANSACTION? Also goes for COMMIT TRANSACTION vs COMMIT? (0 Replies)
Discussion started by: dan139
0 Replies

4. UNIX for Dummies Questions & Answers

Finding return code for completed process ??

I have Process Id for one background process and currently it is running state. I want to see the return code after the above running process is done. for the forground process normally I use "echo $?". But how to get the return code for my background process on UNIX/Linux?? Thanks in... (5 Replies)
Discussion started by: sriraman2
5 Replies

5. SuSE

In KDE Copy completed not always mean files were copied to USB flash drive - how to fix it?

I have noticed that when I copy files to flash disk and in UI I see message copy completed in notification area on task bar, usually copy is not completed. So, if I eject the media I loose data. It is very serious problem because may cause loss of valuable and even critical data. Moreover, when... (2 Replies)
Discussion started by: netwalker
2 Replies

6. Shell Programming and Scripting

Append transaction header lines to same transaction's detail lines

Hi guys, I was wondering if someone can give me a hand in helping me append transaction header line in a file at the end of the transaction detail lines. Basically, I have a file that looks like this: FHEAD File1 THEAD TRANS1-blah TDETL HI1 TDETL HI2 TDETL HI3 TTAIL TRANS1-blah THEAD... (3 Replies)
Discussion started by: rookie12
3 Replies

7. UNIX and Linux Applications

Got Errors while sending a transaction through ESB

We are getting below error when processing a transaction through ESB. I work for SOA admin and checked the JCA connection is working fine also code also working fine in other envs. An unhandled exception has been thrown in the ESB system. The exception reported is:... (1 Reply)
Discussion started by: KuldeepSinghTCS
1 Replies

8. Shell Programming and Scripting

average transaction time

Hi all, I have large daily log file(s) that hold the times for requests and responses on different system requests. What I want to do is work out average transaction times for the day (one log = one day). The problem I'm having is figuring out how to skip rows, i've sorted the output by uniq... (2 Replies)
Discussion started by: nhatch
2 Replies

9. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies
Login or Register to Ask a Question