Hi,
I am trying to avoid unnecessary downloads by checking if file is already exist and correct SHA1.
I can see interesting behavior by client due to prefetch block
Does prefetch reset __Download folder of site every time ?
Let me know if this is obvious , I’m not recollecting __Download behavior
Can you suggest on this limitation ?
Before Adding prefetch block –
/ / Enter your action script here
parameter “PackageBinary” = "WIN_CIAP_TEST_1_0.zip"
parameter “Binaryfile” = "{pathname of client folder of current site}__Download{parameter “PackageBinary”}"
parameter “packageType” =“OnDemand”
if { exist files (parameter "Binaryfile") whose (sha1 of it = "483f33998a5456e0ea8bc94b6c8df5c34c149a4b" and size of it = 71554)}
parameter "downloadRequired" = "NO"
else
parameter "downloadRequired" = "YES"
if {(parameter "packageType") = "OnDemand"}
setting "_BESClient_Download_Direct"="1" on "{now}" for client
download now {parameter "DownloadURL"}
setting "_BESClient_Download_Direct"="0" on "{now}" for client
else
download now {parameter "DownloadURL"}
endif
endif
Relevant - WIN_DownloadExist_File_1_0 (fixlet:142065)
At 17:43:06 -0500 -
ActionLogMessage: (action:142065) Action signature verified for Execution
ActionLogMessage: (action:142065) starting action
At 17:43:06 -0500 - actionsite (http://bigfixdev.nam.nsroot.net:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded parameter “PackageBinary” = “WIN_CIAP_TEST_1_0.zip” (action:142065)
Command succeeded parameter “Binaryfile” = “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_WIN_Software__Download\WIN_CIAP_TEST_1_0.zip” (action:142065)
Command succeeded parameter “packageType” =“OnDemand” (action:142065)
Command succeeded parameter “downloadRequired” = “NO” (action:142065)
After Adding prefetch block –
// Download tools
begin prefetch block
parameter "downloadUtilities"="{pathname of file "downloadUtilities.spec" of client folder of site "CustomSite_WIN_Software"}"
add prefetch item {concatenation ";" of lines of file (parameter "downloadUtilities")}
end prefetch block
// Enter your action script here
parameter "PackageBinary" = "WIN_CIAP_TEST_1_0.zip"
parameter "Binaryfile" = "{pathname of client folder of current site}\__Download\{parameter "PackageBinary"}"
parameter "packageType" ="OnDemand"
if { exist files (parameter "Binaryfile") whose (sha1 of it = "483f33998a5456e0ea8bc94b6c8df5c34c149a4b" and size of it = 71554)}
parameter "downloadRequired" = "NO"
else
parameter "downloadRequired" = "YES"
if {(parameter "packageType") = "OnDemand"}
setting "_BESClient_Download_Direct"="1" on "{now}" for client
download now {parameter "DownloadURL"}
setting "_BESClient_Download_Direct"="0" on "{now}" for client
else
download now {parameter "DownloadURL"}
endif
endif
Result
ActionLogMessage: (action:142068) Action signature verified for Downloads
ActionLogMessage: (action:142068) Non-Distributed - DownloadsAvailable
ActionLogMessage: (action:142068) Action signature verified for Execution
ActionLogMessage: (action:142068) starting action
At 17:44:26 -0500 - actionsite (http://bigfixdev.nam.nsroot.net:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded parameter “downloadUtilities”=“C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_WIN_Software\downloadUtilities.spec” (action:142068)
Command succeeded parameter “PackageBinary” = “WIN_CIAP_TEST_1_0.zip” (action:142068)
Command succeeded parameter “Binaryfile” = “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_WIN_Software__Download\WIN_CIAP_TEST_1_0.zip” (action:142068)
Command succeeded parameter “packageType” =“OnDemand” (action:142068)
Command succeeded parameter “downloadRequired” = “YES” (action:142068)
Command succeeded setting “_BESClient_Download_Direct”=“1” on “Fri, 26 Jan 2018 17:44:26 -0500” for client (action:142068)
strong text