Re: Creating tar file for use on Linux

2019-05-03 Thread Grant Taylor

On 5/3/19 2:13 PM, Don Poitras wrote:

Well, no one told me till today. :)


Better late than never?


Seriously, what's wrong with scp?


10 hack
20 kludge
30 goto 10

My understanding is that scp uses a terminal connection between scp on 
one end talking to scp as a remote command on the other end, through the 
same type of connection that you would ssh through.  Control and data 
are mixed.  I'm not confident that it's true 8-bit clean.  (Think escape 
sequence.)


Conversely sftp actually establishes multiple separate channels in the 
ssh connection.  Control and data are independent.  The data is 8-bit clean.


I've found that scp works > 95% of the time for me.  But there are 
exceptionally rare (for me) cases where I have to use sftp.



The problem with sftp is that it's interactive.


Yes, sftp is meant to be a drop in replacement for interactive ftp.

It's also possible to pull / get files via sftp non-interactively.

sftp : 

I don't remember the syntax to push / put files remotely at the moment. 
But I'd be shocked if there wasn't a way to do it.


I can write scripts where I call scp over and over with a syntax that 
is simple and intuitive.


Yep.

sftp can also pull / get files the same way.


Everywhere _but_ z/OS, it is the most useful way I know to transfer files.


I use scp extensively.  I just do so knowing that there are corner cases 
that can bite.




--
Grant. . . .
unix || die

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Don Poitras
Yes, the z/OS scp is BAD. Grant seemed to think that scp on other platforms
was also not-good. That's what I was asking about.

In article <71e3e36b-a792-4307-b6b8-67f2ced4a...@hogstrom.org> you wrote:
> IBM???s OpenSSL impl??mentation ???attempted??? to fix transfers via scp by 
> treating all files like they were character and does a code conversion from 
> 1047 to 8859 or some such nonsense.  
> Scp will not work without some calestentics that are just plain frustrating 
> but Z makes sure it will be consistently frustrating for 50 years so there is 
> that :)   Don???t expect a fix.
> Use sftp using binary transfer and your life will be better (not perfect, 
> there are code pages 1047, 37, ??? 
> Matt Hogstrom
> m...@hogstrom.org
> +1-919-656-0564
> PGP Key: 0x90ECB270
> ???It may be cognitive, but, it ain???t intuitive."
> ??? Hogstrom
> > On May 3, 2019, at 4:13 PM, Don Poitras  wrote:
> > 
> > In article 
> >  you 
> > wrote:
> >> On 5/3/19 1:00 PM, Don Poitras wrote:
> >>> z/OS scp is BAD. There's no way to tell it to do binary without doing 
> >>> something like Paul's piping conniptions.
> >> Many will tell you that scp itself is not-good and that you should use 
> >> sftp instead.
> >> Perhaps z/OS's scp is worse than scp by itself.
> >> -- 
> >> Grant. . . .
> >> unix || die
> > 
> > Well, no one told me till today. :) Seriously, what's wrong with scp?
> > The problem with sftp is that it's interactive. I can write scripts where
> > I call scp over and over with a syntax that is simple and intuitive. 
> > Everywhere _but_ z/OS, it is the most useful way I know to transfer 
> > files.

-- 
Don Poitras - SAS Development  -  SAS Institute Inc. - SAS Campus Drive
sas...@sas.com   (919) 531-5637Cary, NC 27513

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Matt Hogstrom
IBM’s OpenSSL implémentation “attempted” to fix transfers via scp by treating 
all files like they were character and does a code conversion from 1047 to 8859 
or some such nonsense.  

Scp will not work without some calestentics that are just plain frustrating but 
Z makes sure it will be consistently frustrating for 50 years so there is that 
:)   Don’t expect a fix.

Use sftp using binary transfer and your life will be better (not perfect, there 
are code pages 1047, 37, … 

Matt Hogstrom
m...@hogstrom.org
+1-919-656-0564
PGP Key: 0x90ECB270


“It may be cognitive, but, it ain’t intuitive."
— Hogstrom

> On May 3, 2019, at 4:13 PM, Don Poitras  wrote:
> 
> In article  
> you wrote:
>> On 5/3/19 1:00 PM, Don Poitras wrote:
>>> z/OS scp is BAD. There's no way to tell it to do binary without doing 
>>> something like Paul's piping conniptions.
>> Many will tell you that scp itself is not-good and that you should use 
>> sftp instead.
>> Perhaps z/OS's scp is worse than scp by itself.
>> -- 
>> Grant. . . .
>> unix || die
> 
> Well, no one told me till today. :) Seriously, what's wrong with scp?
> The problem with sftp is that it's interactive. I can write scripts where
> I call scp over and over with a syntax that is simple and intuitive. 
> Everywhere _but_ z/OS, it is the most useful way I know to transfer 
> files.
> 
> -- 
> Don Poitras - SAS Development  -  SAS Institute Inc. - SAS Campus Drive
> sas...@sas.com   (919) 531-5637Cary, NC 27513
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Don Poitras
In article  
you wrote:
> On 5/3/19 1:00 PM, Don Poitras wrote:
> > z/OS scp is BAD. There's no way to tell it to do binary without doing 
> > something like Paul's piping conniptions.
> Many will tell you that scp itself is not-good and that you should use 
> sftp instead.
> Perhaps z/OS's scp is worse than scp by itself.
> -- 
> Grant. . . .
> unix || die

Well, no one told me till today. :) Seriously, what's wrong with scp?
The problem with sftp is that it's interactive. I can write scripts where
I call scp over and over with a syntax that is simple and intuitive. 
Everywhere _but_ z/OS, it is the most useful way I know to transfer 
files.

-- 
Don Poitras - SAS Development  -  SAS Institute Inc. - SAS Campus Drive
sas...@sas.com   (919) 531-5637Cary, NC 27513

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Grant Taylor

On 5/3/19 1:00 PM, Don Poitras wrote:
z/OS scp is BAD. There's no way to tell it to do binary without doing 
something like Paul's piping conniptions.


Many will tell you that scp itself is not-good and that you should use 
sftp instead.


Perhaps z/OS's scp is worse than scp by itself.



--
Grant. . . .
unix || die

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Paul Gilmartin
On Fri, 3 May 2019 15:00:04 -0400, Don Poitras wrote:
>
>z/OS scp is BAD. There's no way to tell it to do binary without doing
>something like Paul's piping conniptions.
> 
With conniptioned ssh, you can archive, transfer, and extract in a single
ugly command, either push or pull.

On the first page of the Ref. for tar, I see:
You cannot use tar unless you specify –f.

Ouch!  That's so idiosyncratic.  Is it even true?  (IIRC, POSIX no
longer specifies tar, only pax.)

z/OS pax provides EBCDIC->ASCII conversion (and many others).
That may be useful to the OP.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Don Poitras
In article <0294809266169973.wa.nealesinenomine@listserv.ua.edu> you wrote:
> I use scp which I assumed defaulted to binary. So I did it with sftp and 
> explicitly used binary and all was good. The scp/sftp utility we wrote for 
> CMS defaults to binary so I had made an incorrect assumption. Thanks all for 
> the help.
> Neale

z/OS scp is BAD. There's no way to tell it to do binary without doing
something like Paul's piping conniptions.

-- 
Don Poitras - SAS Development  -  SAS Institute Inc. - SAS Campus Drive
sas...@sas.com   (919) 531-5637Cary, NC 27513

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Neale Ferguson
I use scp which I assumed defaulted to binary. So I did it with sftp and 
explicitly used binary and all was good. The scp/sftp utility we wrote for CMS 
defaults to binary so I had made an incorrect assumption. Thanks all for the 
help.

Neale

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Paul Gilmartin
On Fri, 3 May 2019 13:26:15 -0500, Neale Ferguson wrote:

>When I scp or sftp the tar ball to the Linux system it complains that it 
>doesn't recognize the file as an archive:
>
>$ tar -tf inc.tar 
>tar: This does not look like a tar archive
>tar: Skipping to next header
>tar: Exiting with failure status due to previous errors
>
>I had created it with tar -cf inc.tar ./headers
> 
What does "cksum inc.tar" show at both ends?

Is this an ASCII<->EBCDIC problem?

Can you view it with a simple viewer at both ends?
If it appears to contain some text on z/OS and also on Linux,
it has been translated EBCDIC->ASCII.  That breaks it.

(Is this something similar to C #include files or HLASM macros?)

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Mark Jacobs
Simple question. Did you ftp in binary mode?

Mark Jacobs


Sent from ProtonMail, Swiss-based encrypted email.

GPG Public Key - 
https://api.protonmail.ch/pks/lookup?op=get=markjac...@protonmail.com

‐‐‐ Original Message ‐‐‐
On Friday, May 3, 2019 2:26 PM, Neale Ferguson  wrote:

> When I scp or sftp the tar ball to the Linux system it complains that it 
> doesn't recognize the file as an archive:
>
> $ tar -tf inc.tar
> tar: This does not look like a tar archive
> tar: Skipping to next header
> tar: Exiting with failure status due to previous errors
>
> I had created it with tar -cf inc.tar ./headers
>
> Neale
>
> --
>
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Neale Ferguson
When I scp or sftp the tar ball to the Linux system it complains that it 
doesn't recognize the file as an archive:

$ tar -tf inc.tar 
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

I had created it with tar -cf inc.tar ./headers

Neale

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Paul Gilmartin
On Fri, 3 May 2019 13:12:21 -0400, Don Poitras wrote:
>
>You don't say what error you're receiving. If it's a permission problem,
>use the -o option to disable tar from passing the owner across. ...
>
>If I don't do that, the sender's UID is set and I can't delete the
>files and I have to get someone with root to delete them.
> 
I had such a problem with NFS; Solaris server, MVS client.
MVS client had no facility to prevent such ownership change,
assuming it was the responsibility of the server.  Solaris
could enforce the rule on either the server or the client.
Solaris admins chose to do it on the client and adamantly
refused to change.

Was tar running setuid?

Did the OP need EBCDIC->ASCII translation?  Pax on z/OS,
at least, can do that.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Creating tar file for use on Linux

2019-05-03 Thread Don Poitras
In article <68c2e717-9481-48c0-b6a2-855c33c44...@sinenomine.net> you wrote:
> What incantation of tar or pax do I need to use to create a tar ball under 
> Unix System Services such that it can be transferred to a Linux system and 
> untarred there? Just the straight -cf doesn???t seem to do the trick nor 
> using the -U -X option.
> Neale

You don't say what error you're receiving. If it's a permission problem,
use the -o option to disable tar from passing the owner across. I do

tar -cvof a.tar dir

and untar on linux with

tar -xvf a.tar

with no isssues. 

Whenever I extract a tar file on z/OS, I do the same kind of thing. e.g.

tar -xvof a.tar

If I don't do that, the sender's UID is set and I can't delete the
files and I have to get someone with root to delete them. 

-- 
Don Poitras - SAS Development  -  SAS Institute Inc. - SAS Campus Drive
sas...@sas.com   (919) 531-5637Cary, NC 27513

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Creating tar file for use on Linux

2019-05-03 Thread Neale Ferguson
What incantation of tar or pax do I need to use to create a tar ball under Unix 
System Services such that it can be transferred to a Linux system and untarred 
there? Just the straight -cf doesn’t seem to do the trick nor using the -U -X 
option.

Neale

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN