Operating System - HP-UX
1753797 Members
7338 Online
108805 Solutions
New Discussion

Script for checking file in use and moving file from windows to unix

 
Pando
Regular Advisor

Script for checking file in use and moving file from windows to unix

Hi Everybody,

Here is my situation.
I have a < 100 production machine computers connected to my NAS2000s (Windows 2003). These computers store measurement data after each test to my NAS2000s.
I also have an rx2600 (HP-UX 11.23) where i use cifsclient to connect to a shared folder in my NAS2000s. My problem is this.

(1) I have created a script for moving my data to the unix environment for converting dos to hp-ux ascii, compressing it using gzip, archiving and send it to our customers. I do this on a daily basis. How can i check if the file is in use by windows? If the file is in use, how can i skipped it and move it later?

(2) Also, only certain batches has to be move and it should meet the file name specification. For example, I only want to move files that only have yyyyyy_yyyyyy_PRxxxx.res format. The only important in the filename is the PRxxxx where PR is constant and xxxx is the 4 digit code.

I have also attached the script i made.
I need everybody's expertise on this to improve the script i've made for such process

Many thanks to all.