in reply to How to handle broken tars ?

Use two passes. In the first pass over the directory, make a list of all files in the directory and their size. Ten minutes later, if that size hasn't changed, move them to wherever it is you want.

The logic, in more detail, might look like this:

This doesn't guarantee the tar's aren't corrupt, but it does at least give them time to finish being sent.

Update:

Another strategy might be to attempt to get a flock on the tar. I'm suggesting this under the assumption that the FTP server locks the file while it's still being written to. If that's the case, you won't be able to get a flock on the file while it's being uploaded. And that will tell you whether or not it's safe to process it.


Dave

Replies are listed 'Best First'.
Re: Re: How to handle broken tars ?
by SpaceCake (Initiate) on May 21, 2004 at 16:16 UTC

    ftpwho

    give's me the all the ftp account(s) which are logged in .. also STORE calles where the give partially the filename ..

    unfortunatly the file name aint complete, they are truncated, thatts bad, because all the incoming files have timestemps on them, so I can't even quess them :(