Would it be better to break this up into 2 tasks (1 to do the prefetch and one to do the install)? I had originally tried to use a __createfile to contain the shell commands, but that didn’t seem to work correctly when placed after the prefetch.
delete __createfile
createfile until End_Of_File
#!/usr/bin/ksh
mv __Download/UPC_6.0_Install.gz /var/tmp
cd /var/tmp
/usr/bin/gunzip UPC_6.0_Install.gz
chmod u+x UPC_6.0_Install
./UPC_6.0_Install
rm UPC_6.0_Install
End_Of_File
wait ksh __creatfile
parameter "error" = "{exit code of action}"
if {parameter "error" != "0" }
exit {parameter "error"}
endif
I saw a mention of a prefetch block in another post. Am I not calling the prefetch command correctly?
The difficulty you are experiencing has to do with paths to special files and folders. Only our Action Script commands correctly know how to determine the path to __Download or __createfile. Once you use a shell command you have to explicitly define the path because they do not know how to do the interpretation.
For Example:
move __Download/somefile /tmp/somefile Will work because our “move” command knows how to generate the path to __Download
wait mv __Download/somefile /tmp/somefile Will NOT work because the shell command “mv” has no idea how to generate the actual path to __Download
wait mv {client folder of current site}/__Download/somefile /tmp/somefile Will work because the Relevance substitution will provide the actual path to “somefile”
For simplicity, I like to use the Action Script “move” command to put everything in /tmp/ so that my paths are short. Also, when using __createfile, you will most likely need to change the files permissions prior to executing. You might also need to wrap it in a launching file if you want access to stdout and stderr.
Additionally you can’t do this. In between each action everything is cleaned up so the prefetch wouldn’t be present unless you moved it outside of the clients directory structures.
This also will not work as parameters are set prior to execution of the action. You should put this inline at the point you want it and protect it as it does not existiduring the download phase I use the following to determine success for example and fail the action if it is not 0
continue if {exists true whose (if true then (exit code of action = 0) else false)}
One other thing the move actionscript gives you over an “mv” is the error detection and retries we have built into our system.
I was thinking of making this into 2 tasks, and then I started working on it as one task, and I guess I just didn’t want to give up on doing it that way…
As it is, I have another task that uninstalls the previous version of the program., prior to downloading and installing this version. I created a baseline which runs the uninstall task, and then run the download/install task, so what’s an additional task!