Browse Prior Art Database

Automatically detecting file transfer by FTP is finished

IP.com Disclosure Number: IPCOM000200453D
Publication Date: 2010-Oct-14
Document File: 2 page(s) / 35K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method to detect file transfer by FTP is finished automatically. With this method it is possible to detect FTP file transfer is finieshed outside FPT server and FTP client process.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 54% of the total text.

Page 01 of 2

Automatically detecting file transfer by FTP is finished

Background:


Sometimes DB users need import data from files. But the files come from different branches of DB users . One public directory is setup on DB user central machine.

All branches upload branch data to the public directory by FTP

central machine load branches date to database when the file transfer is finished .

What are the drawbacks of existing solutions?

Current existing import tools does not know when the file transfer is finished. Branch operator need to notify central DB administrator that file transfer is finished, and then DB administrator start importing on central machine manually. If the branches number is huge, It is painful to management data file from branches when importing data .

New method and advantages:


Core idea is implement a new import tool which can monitor one directory and detecting when a new file comes in and when the transfer of new file is finished. When detecting new file transfer is finished, this tool can start importing data automatically without manual intervention.

The key of this solution is to detect when file transfer is finished. The following present one method.
1.When FTP server receive an upload data, it will open file with the specified file name and write receiving data on FTP server .
2.When FTP client finish upload data, FTP server will close file.
3.New import tool read system statistics info to know if one file is opened by some processes . The simplest way is use command 'lsof'.

/proc directory on linux platform(concrete steps refer to section How to monitor if file is opened by FTP


4.If one file is opened by ftpd process, then we know the transfer is still not finished. Otherwise the transfer is finished.

How to monitor if file is opened by FTP process:


In Unix/Linux platform, there is a tool named 'lsof'

However, this tool requires root privilege, but the user who run FTP may not have root privilege, so 'lsof' can't be used by normal user.

Our proposal is discarding 'lsof' command, and turning to query /proc directory for required information.

When a process is started, a folder will be created under /proc, the folder's name is the process ID. We call this kind of folder is process folder. Under the process folder, there is a sub-folde...