Unix administration - ssh and compress problem

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > May 2004 > ssh and compress problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author ssh and compress problem
Max

2004-05-24, 2:30 am

Hi, everyone!

Can anyone please help me to resolve the following "ksh:
/tmp/CSHM2_P3: cannot open" problem?

I have no problem to create empty data file and named pipe on the
remote database server by using ssh.

/usr/local/bin/ssh -l myao billdev2 /bin/touch
/tmp/infranet_cimf_extracts.dat1.Z
/usr/local/bin/ssh -l myao billdev2 /bin/chmod 777
/tmp/infranet_cimf_extracts.dat1.Z


/usr/local/bin/ssh -l myao billdev2 mknod /tmp/CSHM2_P3 p
/usr/local/bin/ssh -l myao billdev2 /bin/chmod 777 /tmp/CSHM2_P3

But when I try to run a background job as the following, I get "ksh:
/tmp/CSHM2_P3: cannot open" error message.

/usr/local/bin/ssh -l myao billdev2 compress < /tmp/CSHM2_P3 >
/tmp/infranet_cimf_extracts.dat1.Z &

Is there any sytax error? It is OK if I run "compress </tmp/CSHM2_P3>
/tmp/infranet_cimf_extracts.dat1.Z &" on the database server.

Thanks,
Max
Darren Tucker

2004-05-24, 2:30 am

In article <aea3ce71.0405232117.21d0b9c0@posting.google.com>,
Max <xiangminyao@yahoo.com> wrote:
[...]
>/usr/local/bin/ssh -l myao billdev2 mknod /tmp/CSHM2_P3 p
>/usr/local/bin/ssh -l myao billdev2 /bin/chmod 777 /tmp/CSHM2_P3
>
>But when I try to run a background job as the following, I get "ksh:
>/tmp/CSHM2_P3: cannot open" error message.


This doesn't happen to be a Linux ox does it? If not, what kind of
system is it?

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
Barry Margolin

2004-05-24, 4:32 pm

In article <aea3ce71.0405232117.21d0b9c0@posting.google.com>,
xiangminyao@yahoo.com (Max) wrote:

> Hi, everyone!
>
> Can anyone please help me to resolve the following "ksh:
> /tmp/CSHM2_P3: cannot open" problem?
>
> I have no problem to create empty data file and named pipe on the
> remote database server by using ssh.
>
> /usr/local/bin/ssh -l myao billdev2 /bin/touch
> /tmp/infranet_cimf_extracts.dat1.Z
> /usr/local/bin/ssh -l myao billdev2 /bin/chmod 777
> /tmp/infranet_cimf_extracts.dat1.Z
>
>
> /usr/local/bin/ssh -l myao billdev2 mknod /tmp/CSHM2_P3 p
> /usr/local/bin/ssh -l myao billdev2 /bin/chmod 777 /tmp/CSHM2_P3
>
> But when I try to run a background job as the following, I get "ksh:
> /tmp/CSHM2_P3: cannot open" error message.
>
> /usr/local/bin/ssh -l myao billdev2 compress < /tmp/CSHM2_P3 >
> /tmp/infranet_cimf_extracts.dat1.Z &
>
> Is there any sytax error? It is OK if I run "compress </tmp/CSHM2_P3>
> /tmp/infranet_cimf_extracts.dat1.Z &" on the database server.


The I/O redirection operators are being processed by the local shell,
not the remote one. You need to quote or escape them if you want those
characters sent to the remote system.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Max

2004-05-24, 11:31 pm

Barry Margolin <barmar@alum.mit.edu> wrote in message news:<barmar-EBE227.10545224052004@comcast.dca.giganews.com>...
> In article <aea3ce71.0405232117.21d0b9c0@posting.google.com>,
> xiangminyao@yahoo.com (Max) wrote:
>
>
> The I/O redirection operators are being processed by the local shell,
> not the remote one. You need to quote or escape them if you want those
> characters sent to the remote system.



Barry,

After I added quotes, it worked for me. Thanks a lot.

The following is the command I used.

/usr/local/bin/ssh -l myao billdev2 "compress < /tmp/CSHM2_P3 >
/tmp/infranet_cimf_extracts.dat1.Z" &

I have another question. Do you know how can get remote compress process's PID?

Thanks,
Max
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com