Downloading and Moving Files From Software Deployment

(imported topic written by thesurg3on91)

Hello,

I have to change some files on many servers. I now understand that BF will not copy files from one server to another, as “Everyone” permissions are needed or “Null Session Shares” are needed. Neither of the two I want to do. I managed to get my files to the BF server via Software Deployment by following article: http://forum.bigfix.com/viewtopic.php?id=141

Once i have the files in the software deployment area, I am having an issue getting the files from that location to the servers. My code is as such:

dos net stop “Service”

move “C:\windows\system32\drivers\etc\hosts” “C:\windows\system32\drivers\etc\hosts.old_11.21.08”

move “C:\Program Files\Legato\nsr\res\servers” “C:\Program Files\Legato\nsr\res\servers.old_11.21.08”

download http://BFSERVER.domain.com:52311/Uploads/3cbaa2662c5d4ec67e262210af2998810c6a20aa/settings.tmp

continue if {(size of it = 977 AND sha1 of it = “3cbaa2662c5d4ec67e262210af2998810c6a20aa”) of file “settings.tmp” of folder “__Download”}

extract settings.tmp

wait __Download\

move __Download\hosts “C:\windows\system32\drivers\etc\hosts”

move __Download\servers “C:\Program Files\Legato\nsr\res\servers”

dos net start “Service”

My move commands don’t work. Is my problem area the Wait command? What is not clear to me is does the move command work on the current directory on the server, or do I have to tell it where the __Download folder is via full path?

Thanks.

(imported comment written by BenKus)

Hi,

In actionscript, your current working folder is the Fixlet folder, which is something like “C:\program files\bigfix enterprise\bes client__besdata\actionsite”. Your “wait __Download” command looks like it won’t really do anything.

What happens when you run this action? Does it report “Failed”, which line does it report failed on?

Ben

(imported comment written by thesurg3on91)

Yes. I get a failed. I just copied the code from my Software Deployment after I uploaded the files to the BF server. I was under the impression this was the method to get files from one location to the servers. You have to upload it via Software deployment, then extract it using the code from the software deployment upload success screen, and then integrate it with your task.

so if my working directory is the actionsite, how do i get files from the software deployment out to servers without using a null session share? when the command

extract settings.tmp completes, how do i move or copy those files to other computers? do you know the path to the extraction folder?

thanks for your help.

(imported comment written by BenKus)

If you double-click on the computer in the action where it says “Failed”, it should tell you which line it failed on.

I am not sure if I understand your comments regarding how to move files… Maybe a quick recap will help avoid confusion:

  • You appear to be doing the right thing.
  • You uploaded the file using the Software Distribution Wizard. Now the file exists on the BigFix Server and is available for download (for any action).
  • Your code looks right:

download http://BFSERVER.domain.com:52311/Upload … ttings.tmp
continue if {(size of it = 977 AND sha1 of it = “3cbaa2662c5d4ec67e262210af2998810c6a20aa”) of file “settings.tmp” of folder “__Download”}
extract settings.tmp

  • When you call the extract command, it will extract the file to the “__Download” folder in the current site. You can easily reference this path by simply using “__Download\filename” OR “__Download\foldername\filename” (if you had multiple folders in your uploaded file).

Hopefully that background helps…

It appears to me that your code is correct except for this:

wait __Download\

I believe that this line will cause a failure (because there is no action to execute) and if you look at your action status you will see this line fail. If you remove this line, it seems like everything else should work…

Note that you might want to add these statements to the front of the action (because if the files already exist, the move will fail):

delete "C:\windows\system32\drivers\etc\hosts.old_11.21.08"
delete “C:\Program Files\Legato\nsr\res\servers.old_11.21.08”

Ben

(imported comment written by thesurg3on91)

Thanks. That worked. I greatly appreciate your help.