VMware Cloud Community
JDLangdon
Expert
Expert
Jump to solution

Esx Scripting Problem

I'm tryin to script the installation of my Esx 3.02 patches and updates but for some reason when running tar -zxvf ESX-1002429.tgz in a script file produces a tar (child): ESX-1002429.tgz\r: Cannot open: No such file or directory error.

I can run the command manually but it will take a while to apply 20 patches onto 10 ESX host servers.

Any help would be greatly apprecaited,

Jason

0 Kudos
1 Solution

Accepted Solutions
ewannema
Enthusiast
Enthusiast
Jump to solution

It looks like the file might have been written using a Windows text editor and transferred to the ESX server in binary format.

Make sure to edit the file in an editor that understands Unix style line endings and start the file off that way. I like Notepad++ for Windows, but you could go full bore and use vi on the ESX server itself to write the script.

http://wannemacher.us

View solution in original post

0 Kudos
6 Replies
ewannema
Enthusiast
Enthusiast
Jump to solution

It looks like the file might have been written using a Windows text editor and transferred to the ESX server in binary format.

Make sure to edit the file in an editor that understands Unix style line endings and start the file off that way. I like Notepad++ for Windows, but you could go full bore and use vi on the ESX server itself to write the script.

http://wannemacher.us
0 Kudos
rpartmann
Hot Shot
Hot Shot
Jump to solution

Hi,

if you want, you could also use the script i posted under

http://communities.vmware.com/message/833806#833806

kind regards,

Reinhard.

ps: Award points if you find answers helpful. Thanks.

ps: Award points if you find answers helpful. Thanks.
JDLangdon
Expert
Expert
Jump to solution

I've already used the dos2unix command so that's not the issue.

The issue appears to be resolved by using the absolute pathing even though the paths were correct.

Jason

0 Kudos
JDLangdon
Expert
Expert
Jump to solution

I'm hoping to implement your script as soon as I can test it out in the lab.

Jason

0 Kudos
Schorschi
Expert
Expert
Jump to solution

If the file is not corrupted, or was not transposed when uploaded to ESX host, this happens, or can happen, when TAR is told it is working with a tgz file and it is not really a true tar-zipped file. Try tar -zxvf versus tar -xvf, if xvf works, then the file named TGZ but it not really tar-zipped, but just tar-ed.

0 Kudos
depping
Leadership
Leadership
Jump to solution

I always use the script made by dominic. it works great: http://www.vmprofessional.com/index.php?content=esx-autopatch

Duncan

My virtualisation blog: