The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
file moving based on file content melvyn.cochrane Shell Programming and Scripting 12 02-15-2008 06:10 AM
How can I tell when an SFTP has finished copying a file? goodmis UNIX for Advanced & Expert Users 3 02-04-2007 12:53 AM
Using Public key in Shell scirpt LochanM Shell Programming and Scripting 1 07-11-2006 09:33 AM
Perl scirpt for automatic file transfer sveera Shell Programming and Scripting 8 08-19-2005 03:39 PM
moving a file? Holistic UNIX for Dummies Questions & Answers 1 02-20-2003 07:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-12-2006
Haleja001 Haleja001 is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 2
Scirpt moving file before it is finished writing

I have a very simple script that uses FTP mv command to move a file from my AIX box to a network server. Is there any flag or something that I can use to ensure that the file is not being written to when the move command goes to move it? I have it set up in cron so it triggers to run automatically and it appears to occasionally move the file while it is being written to so the data is incomplete. Any suggestions would be appreciated.
  #2 (permalink)  
Old 01-12-2006
mahendramahendr mahendramahendr is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2005
Location: London
Posts: 222
The process which writes into the file can create one more trigger file once it is done with writing data, your ftp job can check for the trigger file, if you find the trigger file it means the file is ready for ftp.... is this works out for you ?
  #3 (permalink)  
Old 01-12-2006
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
If you do not have control of the process that is writing to the file, then you should consider using lsof.
  #4 (permalink)  
Old 01-13-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by Ygor
If you do not have control of the process that is writing to the file, then you should consider using lsof.
See the use of lsof in this thread... Checking a file is not being written to
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0