Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-29-2010, 11:10 AM
|
#1
|
LQ Newbie
Registered: Jan 2008
Posts: 6
Rep:
|
Using Autofs to mount CIFS share and busy files?
We have a homegrown process that runs on a windows box and produces a csv file. We mount the directory these are output to using autofs/cifs and then process them using a program on our linux database servers.
Is there a way from linux, looking at the cifs share, to tell if the target file is currently in use by a process on the windows box? We are having issues where an incomplete file is being processed occasionally.
|
|
|
04-29-2010, 11:51 AM
|
#2
|
Member
Registered: Feb 2008
Distribution: Slackware
Posts: 595
Rep:
|
The problem is file locking. I don't know whether file locking exists between a cifs client and a windows server, I would guess it's up to Windows to handle it.
Perhaps using Services for Unix (SFU) on Windows to provide NFS to the linux client might make it happier?
|
|
|
04-29-2010, 12:12 PM
|
#3
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Can you modify the "homegrown process that runs on a windows box" so that it writes the file with one name (say our.csv.part) and then, when it has finished writing it, renames it (to say our.csv)? That way the Linux system would be able to tell if Windows had finished writing it.
|
|
|
04-29-2010, 01:30 PM
|
#4
|
LQ Newbie
Registered: Jan 2008
Posts: 6
Original Poster
Rep:
|
Thanks for the responses.
Unfortunately, I can only change the linux side of things. So changing the windows process isn't a course of action I can take.
|
|
|
04-29-2010, 01:33 PM
|
#5
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Quote:
Originally Posted by wernox
Unfortunately, I can only change the linux side of things. So changing the windows process isn't a course of action I can take.
|
Less robustly the Linux side of things could note the file size, pause a while, check the file size and so on until the size was the same twice.
|
|
|
04-30-2010, 05:39 AM
|
#6
|
Member
Registered: Feb 2008
Distribution: Slackware
Posts: 595
Rep:
|
Or test the modification time before and after the copy and discard and retry if it has changed..
|
|
|
All times are GMT -5. The time now is 11:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|