Ideas to monitor file copying progress for automated script

  • I have a PS script that runs on a schedule.

    This process is automated and the app that calls the PS script is a service that does not have admin privileges.

    This script looks in a certain folder for any files in that folder.

    If files are found, do *magic*, move files to SFTP folder, when all files have fully copied to SFTP folder copy over a control file to start the SFTP process.

    I can have 0-20 files with size ranges from a few KB to ~5GB.

    Due to internal bandwidth constraints, I want to move one file at a time to the SFTP folder.

    Any suggestions on best ways in PS to monitor if a file is still uploading or has finished uploading to a folder?

    I tried BITS Transfer module, but it appears that the user has to be logged in interactively or possibly as a privileged account . Unless I am totally mistaken, this won't work for what I was asked to build.

    I thought about writing a function (or while loop) to check if a given file is locked/unlocked or writing another set of code to check the file size every x seconds to see if the size has changed.

    Any other suggestions? Hoping MS has a CMDLET for this, but have not found it yet.

    Oh yeah, I am stuck with PS version 2.

  • Have you tried setting the authentication mode or supplying credentials? If you don't supply credentials then it defaults to the current user.

    Details can be found here.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

Viewing 2 posts - 1 through 1 (of 1 total)

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