programmer [2]

programmer

Tuesday, June 22, 2010 2:48 PM - susa

using the latest xmanager enterprise 3 release.

is it possible (and how..) to write a short batch file which will

(1) start xterm using a predefined saved session (the one I use when manually starting xterm)
(2) once xterm is ready, send a couple short commands, wait a predefined time and Exit

the commands would need to execute at 3am during the night so that is the reason I would like to run them via a short script if possible

thank you.



Program Ver. : Xmanager 3.0
Connection Method : Xstart connection


Re: programmer

Wednesday, June 23, 2010 2:26 AM - Support

I believe you could do this by using Windows Scheduler and shell scripting. You can make an Xstart session that will execute the series of inline commands such as the following:

command_1 | command_2

And then, configure Windows Scheduler to run the session on specific time.


However, it would be easier to use crond on the remote host to achieve the same goal. Also, if this is a routinely task, it is safer to run the script automatically from the remote side.

Crond is a UNIX/Linux program that executes scheduled command. For more inforamtion on Crond, please visit:

http://linux.about.com/library/cmd/blcmdl8_crond.


---
Technical Support


Re: programmer

Wednesday, June 23, 2010 3:27 AM - susa

can you give an example of what this command1 | command2 looks like

the first command1 would have to contain the needed run statements for starting xterm and connecting to remote unix host

how would it know to wait until the xterm session is ready to accept input before sending the command2 which would be the execution statement of a job on the remote unix host ?

pseudocode (since I don't know the batch syntax for netsarang commands)

runxterm.bat (let's assume started from windows scheduler)

@echo off
c:\program files\netsarang\xterm 'start -session something-predefined'
rem how would this know to wait for a minute ?
rem send this to xterm window once ready for input
rem how do I send the command 'myjob inputfile.dat' ?


Previous views: 109