Quote:
Originally Posted by
zulfikarmd
Thanks mate. We have smbclient set up and I am able to move/copy files onto unix machine periodically. But what i want to do is to run this command once when file is available on the shared drive and then move the files to unix machine. is this possible? any hints?
The main problem you'll have is telling when the file has finished writing out to your shared drive. Periodically doing a file list will show you when it appears but you may jump in and grab half a file that way. If you have control of the process that's creating the file you are looking for, have it write to one file (with a suffix something like '.part') then rename it once it's finished writing it out.
If you don't have control of the creation process, you will need to either rely on timing (ie see the file appear, wait X seconds, then copy it, test the file size, then delete), but that's very dangerous of course.
If you know what the 'proper; file size will be, you can have your watcher script look only for new files that are also of the correct size, but that's not always a luxury you'll have.