lsof permission
Hi..
This is related to the question http://www.linuxquestions.org/questi...ogress-600769/ Im using lsof to track a file transfer.Im moving the file that is completely FTP transfered. If I use "su" and then execute lsof, Im able to see the file transfer and abort the "mv".. But as a user I cldn find in lsof, the file under FTP transfer. Is there any way the user can be added to see the FTP transfered file in lsof? Thanks, Ananth |
Why not just use the "hash" command in the FTP session to track the progress? Or send using some tool which displays progress somehow...
|
The problem is I dont have the control over the ftp session. My script (automated scripts,supposed to do the tasks described above) resides in the site receiving the tranfered files. So the script has to identify the completely transfered files before moving them.
|
what are you trying to do?
it very very difficult to keep track of ftp sessions and the like. I wouldn't try if you want an easy life. why not send a list of the files and their cksums, first of all, these can then be double checked on receipt. |
I see. Incidentally, how are you monitoring the progress using lsof as root, and what version of lsof / the OS are you using?
For files coming to your machine, you can simply look to see the size of the incoming file, so I assume it is the other way round, and that you do not have access to the remote machine to look and see how much of the file has arrived there.... There is a way, assuming the ftp client is not doing anything fancy with the file (like opening multiple connections and sending more than one part of the file at once). The vanilla ftp client which comes with most distros should be fine with the following method. In the /proc filesystem, you will see a directory which corresponds to your ftp client process. To find the process ID, do something like this: Code:
% ps aux |grep ftp Code:
% cd /proc/20917/fd ; ls -l In the /proc/20917/fdinfo directory there is also a file called 6. If I cat this file, I get this sort of thing: Code:
cat /proc/20917/fdinfo/6 |
All times are GMT -5. The time now is 09:36 AM. |