How to recognize that file was uploaded - linux

I am implementing a process that needs to be started when a file was copied (it uses linux). The file is uploaded by external system. I have noticed that file is visible after the copy operation started but the copying takes a few minutes.
How can I recognize taht the copy operation has been finished?

Related

How to convert an EXE file for Windows CE without Active Sync

I'm able to compile and use Active Sync 4.5 to copy and then run application files in a Windows CE based device. Whenever I copy a file to the device Active Sync will say it will convert the file.
This process of manually uploading the files using Active Sync is slow so I'm now sending the files directly using my application and a TCP sort of file receiver. File is being transferred fine (crc checked).
The problem is that the file does not run complaining with a generic message that the file cannot be opened. My first and only guess is related to this "conversion" process that Active Sync is doing.
I could not find any documentation related to what is is this process and how does it work. Is there any place I can find more information about this conversion? Or is there any tool that can pre-convert so I can transfer it?
The first idea about pre-convert was to copy the file to the device and the copy it back using Active Sync but when copying files out of Windows CE it will convert back to PC format.

copy only new files to remote host after write is finished

I have a java application which is writing images to a directory.
I want to copy these images from external utility (not from the java application directly).
I can use scp and/or rsync or other (not sure which one to select) to copy on every, say 5sec interval(mostly using cron).
But the main problem here is to know when the write has been finished ?
For example, if the application write is on-going and the schedule ticks for copy, then the image copied will be corrupted.
So what utility should I go for & how can I make sure that the image copied is legit ?

How to develop a real time file upload with Angular 2 and Node.js?

Usually, while we upload it takes files to the temp directory first and then move it to the desired directory. But I'm working on Big Data e.g. uploading thousands of files at once. So I need to upload those files directly to the desired location and as each one of them uploaded to that directory, the user must see the changes on the dashboard in real time.
Also I need to show user
If any exception has occurred while uploading e.g. if a file causing a problem in the uploading process.
There should be an option to skip that file or retry upload.
Report to show the list of files uploaded successfully vs files that failed to upload.
If there is any network outage, the upload manager should keep retrying until the network is restored.
User can pause upload and can restart it on next login(if it is feasible)
This is about full manipulation of the upload process to give user the best user experience while uploading large sets of data.
You can use ng2-file-upload, it has most of the feature you require.
You can also find demo here.
For rest of the features you require, you can implement those on top of this library (It's better than writing your own code from scratch).

Node.js ensure files are closed

With my js script I am watching a directory for new files and copy them to another location. Other app creates this files.
The problem is that my watch method is triggered as only that external app starts file creation and it is still not full file. Then I copy this trimmed file.
How can I ensure the file is fully created by the external app?

Linux file extensions while uploading file from windows to linux box

Is there anyway we can detect if file writing is complete before start processing file? What i mean is, we have java program written in spring integration and it polls .zip file, as soon as it sees that file, it picks up and start processing it. But in case of large .zip files, before it writes complete file,it is picking up that file and causing an issue.
Does anyone know how to detect if file write is still in progress?

Resources