none
Checksum verification of files written to fileshare RRS feed

  • General discussion

  • Hey guys,

    I need some help creating a script... The script needs to keep a log of the files checked and then pick up the delta each day and check.  So script needs to run each day and check folder of files downloaded and process any new files it has found from the file containing the master of files to check.  Also need daily report of files checked, date checked and number of ones left to check.

    There are in excess of five million files, hence the need to process the delta each day and keep track of what has been checked and what has failed.

    Logic:

    AA01:  file to record found files which have failed checksums
    BB01: file to record found files and also record if they have passed checksum test.

    For each item in the checksum list file traverse fileshare and check if file exists.
    Until EOF of file

    If file not in BB01
    Then
    {
    ---------------------
    If file exists in fileshare then
        {
        calculate file checksum (sha1)
        If  checksum from file !=  to calculated checksum  then
             {
               append to error file AA01
               File path, filename, original checksum, calculated checksum, error msg (checksum does not match)
               Write name of file checked to checked file BB01, but also with message that file failed checksum
              }
             Else {
              Write name of file checked to checked file BB01
           }
        }
      Else
         {    #not sure you need this
             append to error file 
             File path, filename, original checksum, error msg (file not found)
         }
    End loop
    Print error count for each type of error.

    • Changed type Bill_Stewart Friday, January 26, 2018 3:42 PM
    • Moved by Bill_Stewart Friday, January 26, 2018 3:42 PM This is not "scripts on demand"
    Tuesday, December 19, 2017 12:24 PM

All replies

  • Please read this. This forum is for help on a specific scripting issue. Since you have provided no code, just a thought process, we cannot help you as we don't make scripts on demand. See here for that.

    Please start by learning PowerShell or supply the script that you have tried making and let us know a specific issue you are having with it.

    Tuesday, December 19, 2017 2:49 PM
  • If you want to replicate files and copy only new/changed files, there is no need to script it. Just use robocopy.

    This is not the place to ask questions about robocopy, though. Robocopy is a built-in tool that comes with Windows. Just search for examples.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, December 19, 2017 5:06 PM