up vote 0 down vote favorite
share [g+] share [fb]

A client of us, is going to transfer the files to our server. I need to check if the files exist in that inbound directory and if they are , move them to a different directory so I can read them from my code. I need to write a shell script for this. How do I iterate through files in that inbound directory?

link|improve this question
feedback

2 Answers

Write your script around rsync and let it do the work. It does intelligent synchronization of files - locally or on a remote server.

link|improve this answer
feedback

make a cronjob which does this:

find INBOUND -type f -exec mv '{}' THEOTHERPLACE ';'

the tricky part is to find out, if a file is not yet finished (eg, someone is still uploading). you could play around with fuse to find out, if someone is still writing to a file and ignore that file (for now).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.