LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-19-2007, 03:45 AM   #1
champak
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Rep: Reputation: 0
Moving a file that is ftp inprogress


Hi...

Oki here is the thing...
Say a file A.bat is being transfered through FTP to folder A..
Now I will write a cron job that will transfer the file from folder A to folder B based on some criteria..Unix allows me to move a file even if it is not completely ftp tranfered.. .So I should determine if the file has been transfered to A(completely) before transfering to B..How do I do that?

I tried greping the process list trying to find out if any FTP file transfer in progress. But I couldn find any specfic file transfer details.

Any ideas?
 
Old 11-19-2007, 03:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,854

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
lsof can show you if the file is open, but in fact if the file is not moving partition then it probably won't care. once the file is opened, it's location doesn't matter any more, it's a space on a disk that is being read, not a filename in a directory, so renaming / moving within a partition won't affect the actual file itself.
 
Old 11-19-2007, 04:05 AM   #3
champak
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks Chris.
But lsof is not supported in my target system.Also the transfer might be between different partitions.I actualy simulated a scenario like this. I was FTP transfering a file to the source directory. Simultaneously I ran the script to mv the files that are currently in the source directory. My script moves the file(the file that is currently under FTP transfer) but ftp transfer fails with the following message

150 Ok to send data.
> Netout :Software caused connection abort
451 Failure writing to local file.
ftp: 123009195 bytes sent in 10.48Seconds 11743.12Kbytes/sec.
 
Old 11-19-2007, 04:16 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,854

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
what about netstat? what is the target system?
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
moving out home directory during ftp session saeed_zarea Linux - Networking 8 07-12-2011 07:07 AM
In plesk , I wish to have a backup cron job, ftp back up file to another ftp server? muskiediver Linux - General 6 07-16-2009 03:13 AM
Help on moving an existing FTP server krazyglue Linux - Server 8 10-25-2007 02:24 PM
moving directories with FTP illiniguy3043 Linux - Software 2 07-08-2004 12:37 AM
FTP server not working after moving /var jeffpoulsen Linux - Software 2 10-22-2002 04:34 PM


All times are GMT -5. The time now is 09:01 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration