SSIS file system task ignore files in use

  • Hi,

    I have created a package to move IIS log files from their source directory to another directory called processing. However, when the package tries to move the current log file it errors because the file is in use by another process (by IIS as its still writing to it). I would like the package to just ignore the "in-use" file and process the rest and show the package completing successfully. The file in use will be rolled by IIS at midnight and the file will be picked up by the next package run.

    However, when the file is rolled and becomes free a new log file is created which will be marked as "in-use"...... which should be ignored at the next run.

    Is there some way that I can tell the file system task to ignore in use files or add an event handler to do the same sort of thing?

    Any assistance is appreciated.

  • I have resolved the issue with the following example:

    http://www.timmitchell.net/post/2010/08/23/ssis-conditional-file-processing-in-a-foreach-loop/

    What I realised was that I needed to just ignore the current log file which gets created daily, so using the above example (and changing the last written date to created date) I am able to ignore/skip the log thats in use.

    Adam

  • Adam, thanks for the mention! 🙂

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • Hi Tim, no problem and thanks for the great example you covered at the aforementioned URL. It saved me a lot of head scratching and googling!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply