2

So, I am in this little predicament where I am stuck watching a few ftp folders to see if they have new files added to them. If they do, it needs to throw an event with the file name. Thereby telling something else to download that file.

This is a pretty simple object to make, I was just curious if anyone knew how expensive this operation would be?

I plan on using the command NLIST because I don't need file size information, and there will be no sub-directories in the folder. Each file in the folder will have exactly 25 characters in its name.

There could be anywhere from 10 to 'maybe' a couple thousand (max around 2000) files per folder (usually on the lower end, 100-300, but currently growing).

The files are anywhere from 250kb to a very VERY unlikely 10mb (usually within the 250kb to 4mb range).

There possibly could be up to a few hundred folders (in which case I could change the watch frequency depending on number of folders), but currently there are only a few (6-10ish).

There also would be multiple logins for the ftp server, different logins would have access to different folders.

I am not asking for an implementation, just if anyone has some first or second hand knowledge about FTP, how could this affect my network.

I am not opposed to putting in file retention times or change the frequency in which I check for new files.

2
  • There will also only be 1 file per folder per day.
    – Meiscooldude
    Apr 7, 2010 at 22:41
  • Easily solved programmatically. Perhaps you should take this to Stack Overflow. Apr 7, 2010 at 23:34

2 Answers 2

2

Inotify tools:

inotifywait -e create -rmq $watch_directory | while read i; do
    file=$(echo $i | awk '{print$3}') 
    dir=$(echo $i | awk '{print$1}')
    # echo ${dir}${file}
done
2
0

Assuming you have shell access to the FTP server, then dnotify is your friend. Directory change notification.

http://linux.die.net/man/1/dnotify

1

You must log in to answer this question.