Kaseya Community

Write File -validation needed

  • We've found two common problems (OK, 1 problem & 1 annoyance) when downloading files to a client machine via a script.

    1) Problem - sometimes the file does not download completely. I'm not sure if the connection is lost or what but we've had multiple times that larger files (such as 63MB setup programs) are only downloaded 24MB or 30MB or various sizes but not the whole thing. The "Write File" command in the scripts should perform some type of validation such as comparing file size or a hash or whatever to ensure that it downloaded the entire file correctly before going on to the next step.

    2) Annoyance - We often download files to install something but if the file was already downloaded, we don't want to waste the bandwidth and do it again. Sometimes we build an IF/THEN statement just to check if the file already exists but that's extra script complexity for very little value. And it doesn't catch the problem mentioned in #1 regardless. It would be much better if the Write File function worked like the Distribute File function where it checks if the file exists and matches exactly - if it matches, it does nothing, if it doesn't, then it downloads it.

    It seems like Kaseya could easily include this functionality in the scripting since they already have all the logic written for the Distribute File function.

    Does anyone else have this issue or is it just us?

    Legacy Forum Name: Write File -validation needed,
    Legacy Posted By Username: kentschu
  • kentschu

    I couldn't agree more! Thank you for posting this and as you say it should be a pretty simple modification for kaseya I would think.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: jsmall
  • md5sum.exe can be automated in a script if you need a solution today rather that waiting for a kaseya update. Your friend google should have a copy.

    Big hassle factor though.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: chris@busy.co.nz
  • According to the help file, #2 is already implemented.

    Each time a script executes the Write File command, the agent checks to see if the file is already there or not by hashing the file to verify integrity. If not, the file is written. If the file is already there, the script moves to the next step. You can repeatedly run a script with Write File that sends a large file to a managed machine and know that the VSA only downloads that file once.



    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: sequoya
  • The problem with what the help files says, is that if it was unsuccessfully written, the hash won't match and it will try to write it again. It says nothing about checking to ensure it was written correctly the first time.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: doug.jenkins@ispire.ca
  • Sequoya,
    thanks for the info. it's good to know that at least half of what we need is already there.
    I hope Kaseya can do the other half easily to verify integrity the first time.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: kentschu
  • Regarding the annoyance, you can do this yourself in the script...


    Script Name: Test Get File
    Script Description:

    IF Test File
    Parameter 1 : c:\temp\test.exe
    Absent :
    THEN
    Write File
    Parameter 1 : c:\temp\test.exe
    Parameter 2 : VSASharedFiles\test.exe
    OS Type : 0
    ELSE


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Lmhansen
  • Upload the file to an IIS directory and use curl.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: nevesis