Reputation: 3008
I created a video transcoder using ffmpeg. User uploads RAW videos - very big, about 20GB - via FTP.
Currently, a php script is monitoring local paths every 5 seconds with below strategy.
It works very well, but it burns some cpu power to find 'new file'. Is there any way to get the 'exact timing' when file uploading is being completed?
Upvotes: 3
Views: 685
Reputation:
if you can, install inotify then its super easy via a bash script. otherwise a bash script may still be more efficient.
update: php supports inotify with: php.net/manual/en/book.inotify.php
Upvotes: 1
Reputation: 4287
Try making a perl daemon that checks for new files, i think it would be less resource intensive. Also, another more unix like alternative, and i think better overall: http://en.wikipedia.org/wiki/File_Alteration_Monitor
Upvotes: 1