Dynamic Downloading

This page has not been liked. Updated 4/12/13, 8:02 AM by A635_Eoin_GardinerTags: None

 

DownloadWhitelist.txt

This file specifies all the formats allowed for dynamically downloaded files.

The location of the file on the TEM server is:

C:\Program Files (x86)\BigFix Enterprise\BES Server\Mirror Server\Config

The file contains file formats such as the following, and can specify TEM server locations or external locations

http://127.0.0.1:52311/.*
http://software\.bigfix\.com/.*
http://127.0.0.1:52311/bfmirror/downloads/ScriptManifest.lst

See Introducing Dynamic Downloads in the Action Guide:

http://support.bigfix.com/fixlet/documents/WinActions_81_110817.pdf

 





Using a prefetch block with collect

The prefetch block allows you to perform a 'collect' which can be used within the block to download a file manifest, then read the lines of the manifest to download the files it specifies, all within the prefetch block.

Note that a prefetch block must be placed at the start of an Action

The following example Action downloads a file manifest and then the files specified in the manifest:

begin prefetch block
//First download the file manifest. This will be read to determine the script to be downloaded.
//
add prefetch item name=ScriptManifest.lst sha1=667852a4dbf55fb6fc1e3400a150fa785efdc3bd size=421 url=http://127.0.0.1:52311/bfmirror/downloads/ScriptManifest.lst
collect prefetch items
//
//Now read the file manifest and download the scripts specified in it:
//
add prefetch item {following text of first "Script1:" of line whose (it contains "Script1") of download file "ScriptManifest.lst"}
add prefetch item {following text of first "Script2:" of line whose (it contains "Script2") of download file "ScriptManifest.lst"}
add prefetch item {following text of first "Script3:" of line whose (it contains "Script3") of download file "ScriptManifest.lst"}
end prefetch block
//
//Now execute the downloaded scripts.
wait chmod 700 __Download/{preceding text of first " " of following text of first "name=" of line whose (it contains "Script1:") of download file "ScriptManifest.lst"}
wait __Download/{preceding text of first " " of following text of first "name=" of line whose (it contains "Script1:") of download file "ScriptManifest.lst"}
wait chmod 700 __Download/{preceding text of first " " of following text of first "name=" of line whose (it contains "Script2:") of download file "ScriptManifest.lst"}
wait __Download/{preceding text of first " " of following text of first "name=" of line whose (it contains "Script2:") of download file "ScriptManifest.lst"}
wait chmod 700 __Download/{preceding text of first " " of following text of first "name=" of line whose (it contains "Script3:") of download file "ScriptManifest.lst"}
wait __Download/{preceding text of first " " of following text of first "name=" of line whose (it contains "Script3:") of download file "ScriptManifest.lst"}
//

 

Changing script file permissions for execution



Note that if you are are chmod-ing a script file just before executing, make it a 'wait' command, not a run command, to make sure that the command is complete before the script is kicked off

If you use the run command, it is possible to get errors due to permissions not being right for execution.