Re: Running a job on a remote machine (and continues "here" after it's done)



S-Y. Chen schrieb:
On Oct 18, 12:15 pm, "S-Y. Chen" <shenyeh_c...@xxxxxxxxxxx> wrote:
Thanks a lot for all of you. I will do some work by myself and see
where I can get

Thanks again.

Regards
S-Y. Chen

On Oct 18, 8:20 am, cla...@xxxxxxxxx (Cameron Laird) wrote:

In article <5nn2b1Fiuh1...@xxxxxxxxxxxxx>,
Michael Schlenker <schl...@xxxxxxxxxxxxxxxx> wrote:
schl...@xxxxxxxxxxxxxxxx schrieb:
S-Y. Chen wrote:
I have read some similar topics, but because I am new to this, I am
still going to post my question here.
My software uses Tcl/Tk as the scripting language, and one of my
customers is asking if we can do this in Tcl/Tk
1. The Tcl/Tk shell (let's call it Host) sit on a Windows machine
2. The Host will create some files (say, file01.txt) on the local
machine.
3. The Host will send file01.txt to a remote machine (through whatever
means). The machine can be linux, unix or windows
4. file01.txt will have to be fed into some programs in the remote
machine and execute the program. Something like
program01.exe < file01.txt > file02.txt
5. the Host will wait until program01.exe finishes. Then it will grab
some files from the remote machine back to the Host.
6. The Host will do some processing, and go back to step 2 again.
Is it possible to do all these ? The host will have to wait until the
execution is done. That is, I want to perform something like the exec
command, but the program is on another machine (and maybe with
different OS).
Yes, this is possible and easy to do in Tcl. But check if your
host shell has a working Tcl event loop, otherwise most solutions will
not really work, as they usually use Tcls event based networking.
I wrote something like that for a former job, based on SOAP
(controlling some Perl scripts), and some
similar thing recently for controlling a Test framework and
synchronously
an Ethereal network capture with live display of the decoded packages
on
the control host.
I did read some material. Thanks again for all of you.

I have few very simple question
*g* those are the hard parts actually...

1. what should I do if I need a password to login another machine
Depends on what you mean by 'login'. If you can install a service daemon
there (aka have the comm listener running there) your done and just
connect to that service. If not your usually in for something like using
tcllib ftp, using expect to automate ssh or some similar scheme of
remote login.
2. how do I know which port I should use
Either pre shared knowledge or using a name service (e.g. this one or
any other http://tcllib.sourceforge.net/doc/nns_server.html). The easy
way is to just define that your service always listens on some port >1024.
3. Does the "command" it sends through comm needs to be a Tcl command
too ? or a shell command is also OK ?
It has to be a Tcl command, but it would be easy to write a Tcl command
that simply invokes a shell with the args and returns the values.

4. and, how can I just simply send a file to another computer ?
Depends on what you mean by simply. You nearly always need the receiving
end prepared for your send, be it that an ftp server runs, that it
exports some shares via nfs or cifs, that it has an sshd running or some
kind of comm server or lots of other options.

So it all depends a bit on your context, especially how much control you
have over both sides of the connection.

From your questions it seems you might be well served by either some
kind of ssh scripting via Expect or some distributed com stuff on
windows, but as i said, there are lots of other options. Try to describe
your setup a bit more closely.

Michael
.



Relevant Pages

  • Re: Finnish Tclers
    ... > couldn't name any Finnish programmer who is using Tcl/Tk in work or ... I know of at least two companies who still use Tcl: ... One problem is also that the universities here don't teach scripting ...
    (comp.lang.tcl)
  • Re: Can Ruby read emails?
    ... command, and Ruby will read it and exacute that command. ... I actually wrote a system using Tcl some years back which used ... e-mail to "move" a software agent from one host to another. ...
    (comp.lang.ruby)
  • Scripting SSH with Activestate Expect and TCL...? chars inserted in terminal
    ... I'm new to tcl, expect, and coding from a windows environment;) I am ... using ctivestates distribution of Expect and TCL on a Windows XP host ... I have it passing the password to sudo properly. ...
    (comp.lang.tcl)
  • Re: Running a job on a remote machine (and continues "here" after its done)
    ... My software uses Tcl/Tk as the scripting language, ... The Tcl/Tk shell (let's call it Host) sit on a Windows machine ... The Host will send file01.txt to a remote machine (through whatever ... Check out the SIMPL project at: ...
    (comp.lang.tcl)
  • Re: file handling problem on windows with tcl8.4.14
    ... but in tcl I can open and read this file -> readable ... What is the server ... If .host is the real name of the host machine - perhaps this causes ... Shared Folders are ...
    (comp.lang.tcl)