Kaseya Community

Creating a zipped file using scripts

  • Hello,

    Does anyone know if it is possible to create a script which zips a file? I am trying to grab an entire folder but I don't think I can unless it's zipped.CouldI mabye make it a batch file? Please let me know.

    Thanks,

    Tom


    Legacy Forum Name: Creating a zipped file using scripts,
    Legacy Posted By Username: tecook7
  • zip.zip
    here you are

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: restech
  • Thanks for the script and at the risk of sounding dumb (although in my defense I am relatively new to Kaseya) in which step do I put the file path I want it to zip?

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: tecook7
  • the step with the agruments for ZIP.exe, this is more to do with knowing how to write scripts than kaseya. Should be self explanatory.

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: restech
  • yeah, i've taken the training on writing scripts but the only examples they ever used were how to run a defrag and get file, two useful things but not very complicated.

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: tecook7
  • Hello again,

    I have modified this script the way I want it however it keeps failing in step three. If I choose to continue the script if step three fails then it fails on step 5. Does anyone see anything wrong with this script? Any help would be much appreciated.

    IF True
    THEN
    Write File
    Parameter 1 : c:\temp\zip.exe
    Parameter 2 : VSASharedFiles\zip.exe
    OS Type : 0
    Execute File
    Parameter 1 : c:\temp\zip.exe
    Parameter 2 : -f -R c:\temp\dr.zip "c:\Program Files\Symantec\Backup Exec\idr\Data\*.*" >> c:\temp\log.txt
    Parameter 3 : 3
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : c:\temp\log.txt
    Parameter 3 : LOG
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : #LOG#
    OS Type : 0
    Get File
    Parameter 1 : c:\temp\dr.zip
    Parameter 2 : IDR\DR\dr.zip
    Parameter 3 : 1
    OS Type : 0
    ELSE


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: tecook7
  • focus on using zip manually at the command line, then translate that to the K Script

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: restech
  • thanks for all the help. i got it working. it was a time problem. the script wanted to grab the zipped file before the machine was done zipping it.

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: tecook7
  • Personally I tend to use 7zip to perform this and often use a SMTP command line tool such as "blat" to email the zips to an email address.

    Have used such a setup in the past for emailing of performance logs, backup logs, etc.


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: nigel_bca
  • ---


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: frodoo