I have a file located at http://10.0.0.14/esxupdate/test.txt and I want to copy it to /home/scripts on my ESX server. I'm trying to do this from a putty session on my ESX server. I tried this...
cp http://10.0.0.14/esxupdate/test.txt
But that did not work. How can I copy this file to my ESX server?
Hello,
All you should need to issue is:
lwp-download
There is no need to enable and disable port 80 going out. It is allowed by default.
Best regards,
Edward L. Haletky, author of the forthcoming 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', publishing January 2008, (c) 2008 Pearson Education.
Google for WinSCP or FastSCP. Both are free Windows utilities that will make it very easy to copy files from your Windows box to your ESX server and vise versa.
Chris
I already have and use WinSCP, but I would like to know how I can do this from the console so I can script it.
With Linux you could use the get command but I don't think it is included with ESX. Could you use scp or ftp to get the file instead?
Hello
You can use this command from the Virtual Console
from a perl script ***
use LWP::Simple;
`esxcfg-firewall -o 80,tcp,out,httpClient`;
getstore ("http://10.0.0.14/esxupdate/test.txt",'/tmp/test.txt');
`esxcfg-firewall -c 80,tcp,out,httpClient`;
from command line / batch ***
esxcfg-firewall -o 80,tcp,out,httpClient
perl -MLWP::Simple -e 'getstore "http://10.0.0.14/esxupdate/test.txt",'/tmp/test.txt'
esxcfg-firewall -c 80,tcp,out,httpClient
Hi
Can you attach the script.
Did you make the script executable?
Hello,
You need more steps to build and run a script
1. Make the script executable "chmod +x script_name"
2. You have to inser in your script the type at the first line (#!/usr/bin/perl -w or #!/bin/sh)
3. Before run those line in a script have you try to run from the command line directly in the console?
Hello,
For you information, you may use proper extention for your script
Perl : script_name.pl
Shell : script_name.sh
Your format will work but it will be simple for you to identify the script language (type)
Thanks jfrichard! I'm new to scripts so let me try to understand this. I have a file called patch.script that contains the following:
esxcfg-firewall -allowOutgoing
esxupdate --noreboot -r http://10.0.0.15/esxupdate/11-30-06/ESX-1006511 update
esxcfg-firewall -blockOutgoing
I list all my updates in this file and it works well. Is this really a script file? I don't think I ran "chmod +x script_name" on this file. I think I just ran "chmod 775 script_name". When I launch it using ./patch.script, it works. Also, the commands you listed under "command line/batch", should I be able to type them at the console? The first command worked, but the second one (perl -MLWP::Simple -e 'getstore "http://10.0.0.14/esxupdate/test.txt",'/tmp/test.txt') left me at a ">" prompt. I'm not sure how to exit out and get back to the normal prompt.
I'll take a close look at those links, but I'd still like to know how to copy this file over when connected with putty. In your following example...
esxcfg-firewall -o 80,tcp,out,httpClient
perl -MLWP::Simple -e 'getstore "http://10.0.0.14/esxupdate/test.txt",'/tmp/test.txt'
esxcfg-firewall -c 80,tcp,out,httpClient
Should this work if I type this in a putty session? The first command seems to work, but the second command does not... it brings me to a ">" prompt.
Thanks!
Hello,
All you should need to issue is:
lwp-download
There is no need to enable and disable port 80 going out. It is allowed by default.
Best regards,
Edward L. Haletky, author of the forthcoming 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', publishing January 2008, (c) 2008 Pearson Education.
Edward, you are the man! That works awesome! Thank you, thank you, thank you! Looking forward to the release of your book!