file activity (open/closed) file descriptor info using KORN shell scripting


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers file activity (open/closed) file descriptor info using KORN shell scripting
# 1  
Old 06-07-2004
Question file activity (open/closed) file descriptor info using KORN shell scripting

I am trying to find a way to check the current status of a file. Such as some cron job processes are dependent on the completion of others. if a file is currently being accessed / modified or simply open state I will wait until it is done being processed before attempting the next process on that file. Mainly the final process that zips previous days files up. I want to hold off archiving the previous days file until it is no longer being accessed.

thanks!
# 2  
Old 06-07-2004
If you know the file name, try either lsof or fuser.
They return information about open files, and if it is open.
# 3  
Old 06-07-2004
Thanks Jim.

I was kink of hoping there was something like a conditional switch or something like that. i.e. -f , -c ...

but this is good I will try this. the only thing is sometimes the admins are for some reason reluctant to put some of these neat Unix utilities on the machine. Smilie
# 4  
Old 06-07-2004
The reason is you need privs -superuser - to run fuser.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dialog box in korn shell scripting

Does dialog box works on all kind of shells? I am using korn shell in Linux . For me dialog is not working :) is there any particular syntax or do we need to have particular OS version or shell env? #!/bin/ksh dialog --title "create file" \ --backtitle "shell script practice" \... (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

2. Shell Programming and Scripting

Help needed in Korn Shell scripting

#! /bin/ksh while read line do if ] ; then echo "no data" continue; fi echo "performing operation on $line" done < prg.txt (3 Replies)
Discussion started by: Juhi Kashyap
3 Replies

3. Homework & Coursework Questions

korn shell scripting

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: There is a menu driven program and there are some fields to be achived 3. Display contents of all .lst files... (3 Replies)
Discussion started by: jainitai
3 Replies

4. UNIX for Advanced & Expert Users

Comparison in Korn shell scripting

I have a scenario to implement in Korn shell script. Here it is.. I need to compare two values to see whether they are same or not. The issue is that the values coming in for comparison can be a string or an integer which can be determined during run time only. Which korn shell comparison... (2 Replies)
Discussion started by: vani123
2 Replies

5. Shell Programming and Scripting

Korn shell scripting

I am attempting to learn shell programming using o'rielly book "Learning the Korn Shell". I am finding it pretty difficult to do since the only access I have to unix boxes are running version 99 of ksh. The book utilizes ksh93 and there appear to be many differences. I can't even follow along... (2 Replies)
Discussion started by: vedder191
2 Replies

6. UNIX for Dummies Questions & Answers

good book to learn korn shell scripting

which is a gud book to learn advanced korn shell scripting? i know the basic shell scripting (1 Reply)
Discussion started by: shishirkotkar
1 Replies

7. Shell Programming and Scripting

Solaris Korn Shell Scripting

I have made the following simple script: a=0 let a=$a+1 if "] then mailx -s "Up" abc@yahoo.com fi When I run the above script, I get the following error: # ./new.ksh ./new.ksh: ]: not found. Please tell me how to use if here? (6 Replies)
Discussion started by: kamaldeep1986
6 Replies

8. Shell Programming and Scripting

Urgent Korn Shell scripting Help Pleaaaase...

Hello All, Can someone help me to set a user's password from the script using korn shell. The password change is a one time password after user account creation. I tried providing the input file as the value for password field but password change requires tty so my password from an input file... (3 Replies)
Discussion started by: solaix14
3 Replies

9. UNIX for Dummies Questions & Answers

Help with Korn Shell Scripting

Hi I'm new to scripting and I don't know where to start. I need to create a script that needs to look for specific files in a specific folder then I need to return the filename, the recordcount, bytecount and checksums. Then I need to write these results into a new file. I would appreciate... (2 Replies)
Discussion started by: th0123
2 Replies

10. Shell Programming and Scripting

Repost-Korn Shell Scripting

Hi, being very new to Korn Shell Scripting I am hoping that someone here can help me. I want to compare file name in scp/inbox directory to file name stored inside a file in pnt/compare directory. Hi, being very new to Korn Shell Scripting I am hoping that someone here can help me. I want to... (1 Reply)
Discussion started by: hanie123
1 Replies
Login or Register to Ask a Question