LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-29-2010, 11:10 AM   #1
wernox
LQ Newbie
 
Registered: Jan 2008
Posts: 6

Rep: Reputation: 0
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.
 
Old 04-29-2010, 11:51 AM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 116Reputation: 116
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?
 
Old 04-29-2010, 12:12 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
Old 04-29-2010, 01:30 PM   #4
wernox
LQ Newbie
 
Registered: Jan 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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.
 
Old 04-29-2010, 01:33 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by wernox View Post
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.
 
Old 04-30-2010, 05:39 AM   #6
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 116Reputation: 116
Or test the modification time before and after the copy and discard and retry if it has changed..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount cifs share problems BarryLinux Linux - Newbie 11 06-04-2012 01:42 AM
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied CADIT Linux - Newbie 6 11-20-2009 03:48 PM
Can delete files in one smb share but not in another - using cifs.mount in active dir Lordandmaker Linux - Server 4 02-12-2009 06:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration