Kaseya Community

GET URL not working - we doing something wrong?

  • Very simple script - need to download a large file for a client off-hours and wanted to schedule it.

    So we setup a script that essentially performs a GET URL, with the full HTTP path of the file as if we typed it into IE, and gave it a location to dump the file. Doesn't work.

    See script below -

    Script Name: Download BE12
    Script Description: Downloads BackupExec 12 (trial) from Symantec and places it on D:

    IF True
    THEN
    Get URL
    Parameter 1 : http://esdownload.symantec.com/akdlm/CD/MTV/BEWS_12.1364_32BIT_VERSION.zip
    Parameter 2 : "d:\BEWS_12.1364_32BIT_VERSION.zip"
    Parameter 3 : 3
    OS Type : 0
    ELSE

    Script says it runs successfully IMMEDIATELY even though we tell it to hold until completion, but no file.

    Any takers?

    Legacy Forum Name: GET URL not working - we doing something wrong?,
    Legacy Posted By Username: DiPersiaTech
  • Out of curiousity, have you tried changing the path where it is being saved? Try D:\BEWS.zip.

    Or, if its possible, are you able to host this file on your KServer and use the Write File command? It may take up a bit of your own bandwidth, but it works when I deploy applications =]

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: LANWorx
  • We did try a few different paths and names. I ASSUME that since we've setup our scripts to run as the admin, it shouldn't be a security issue.

    We don't want to host this file on our KServer - it's about 500 meg!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: DiPersiaTech
  • Yeah, BE isn't small!

    Try chucking an impersonate user command as the first step and use your domain admin credentials, this will rule out a permissions error.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: LANWorx
  • Maybe try wget.exe? wget is small enough to be deployed from your kserver and command-line scriptable.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: CeruleanBlue
  • DiPersiaTech
    Very simple script - need to download a large file for a client off-hours and wanted to schedule it.

    So we setup a script that essentially performs a GET URL, with the full HTTP path of the file as if we typed it into IE, and gave it a location to dump the file. Doesn't work.

    See script below -

    Script Name: Download BE12
    Script Description: Downloads BackupExec 12 (trial) from Symantec and places it on D:

    IF True
    THEN
    Get URL
    Parameter 1 : http://esdownload.symantec.com/akdlm/CD/MTV/BEWS_12.1364_32BIT_VERSION.zip
    Parameter 2 : "d:\BEWS_12.1364_32BIT_VERSION.zip"
    Parameter 3 : 3
    OS Type : 0
    ELSE

    Script says it runs successfully IMMEDIATELY even though we tell it to hold until completion, but no file.

    Any takers?


    Use a utility named CURL from http://curl.haxx.se. Download the non ssl version from http://curl.hoxt.com/download/curl-7.18.2-win32-nossl.zip.

    From a script, issue the following command:

    curl http://esdownload.symantec.com/akdlm/CD/MTV/BEWS_12.1364_32BIT_VERSION.zip -o c:\BEWS_12.1364_32BIT_VERSION.zip

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: pcmnetmanage
  • Here is a generic script that we use to download files. You will need to customize your desired drive+patch in step 1, and email addres in last step.
    I have already filled in the URL and filename for steps 2 and 3, but you could customize those for other downloads in the future. Hope this helps.

    Lloyd

    Script Name: Get file from website
    Script Description: Download file from URL, save to local folder. NEED TO SPECIFY VARIABLES - TargetDrivePath, FileName, URL

    IF True
    THEN
    Get Variable
    Parameter 1 : 2
    Parameter 2 : d:\foldernamehere
    Parameter 3 : TargetDrivePath
    OS Type : 0
    Get Variable
    Parameter 1 : 2
    Parameter 2 : BEWS_12.1364_32BIT_VERSION.zip
    Parameter 3 : FileName
    OS Type : 0
    Get Variable
    Parameter 1 : 2
    Parameter 2 : http://esdownload.symantec.com/akdlm/CD/MTV/
    Parameter 3 : URL
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : TargetDrivePath=#TargetDrivePath# , URL=#URL# , FileName=#FileName#
    OS Type : 0
    Write File
    Parameter 1 : #TargetDrivePath#\curl-nossl.exe
    Parameter 2 : VSASharedFiles\curl-nossl.exe
    OS Type : 0
    Execute File
    Parameter 1 : #TargetDrivePath#\curl-nossl.exe
    Parameter 2 : #URL#/#FileName# -k -C - -o "#TargetDrivePath#\#FileName#"
    Parameter 3 : 3
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Downloaded file #FileName# from #URL# and saved to #TargetDrivePath#
    OS Type : 0
    Execute Shell Command
    Parameter 1 : eventcreate /L APPLICATION /T INFORMATION /SO WolfTrack /ID 999 /D "Downloaded file #FileName# from #URL# and saved to #TargetDrivePath#"
    Parameter 2 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 6
    Parameter 2 :
    Parameter 3 : Machine
    OS Type : 0
    Send Email
    Parameter 1 : emailaddress@yourcomcompany.com
    Parameter 2 : #Machine# Downloaded file #FileName# from #URL# and saved to #TargetDrivePath#
    Parameter 3 : #Machine# Downloaded file #FileName# from #URL# and saved to #TargetDrivePath#
    OS Type : 0
    ELSE

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • To all,

    Last night, I was running a script that I previously wrote to download the BEWS_12.1364_32BIT_VERSION.zip file using the URL+filename and CURL that pcmnetmanage wrote on July 26th in this thread. It had worked before, but now it looks like Symantec through a username+password page in front of it. Rats.

    Does anyone know how to download the Backup Exec v12 installation CD (zipped) from the internet? Due to the large size, I would rather not use by kserver as the source.

    As always, thanks in advance.

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • Not sure what problem you're having. The curl command works fine for me.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: sequoya
  • Very strange. Maybe Symantec changed the site back again.

    When i simply clicked on the URL link earlier this week, a Symantec front-end webpage asking for username and password was displayed. Now today it goes straight to the download.

    Oh well, at least it is working again.

    Lloyd

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