#41134 - 2003-06-05 06:04 PM
Re: Help with KIX
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Ok, heres a quicky based on the way I like to do this sort of thing, up to you if you want to persue this:
1) Create a file called HOSTS.INI in your current directory, heres a sample:
[HOSTS.INI]
code:
[todo] server1 = 1 server2 = 1 server3 = 1 server4 = 1
[done]
Notice there are two sections TODO and DONE. The todo section contains the list of all the machines to copy the file from. As the files are copied, and if the copy was successfull, the hostname "moves" from the TODO section to the DONE section. That way, if a machine is down or not available, all you have to do is rerun the script, and the script will automatically restart and attempt to copy files from the failed machines.
To reset this script for the another copy, simply (manually) rename the DONE section to TODO, and delete the old TODO section.
Anyways, hope you get the picture. Heres a the script - you must customize it to your environment, good luck:
code:
Break On $HOSTS = ".\HOSTS.INI" $SHARE = "\BUILDS\XML\ENG\" $FILE = "MSXML.MSI" $TARGET = @CURDIR For Each $Host In Split(ReadProfileString($HOSTS,"TODO",""),CHR(10)) If $Host $SRC = "\\"+$HOST+$SHARE+$FILE $TGT = $TARGET+$HOST+"_"+$FILE ?"Copying $SRC to $TGT" COPY $SRC $TGT
?@SERROR ? If @ERROR = 0 $= WriteProfileString($HOSTS,"TODO",$Host,"") $= WriteProfileString($HOSTS,"DONE",$Host,1) EndIf EndIf Next Exit 1
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 857 anonymous users online.
|
|
|