emperor: (Default)
Add MemoryShare This Entry
posted by [personal profile] emperor at 08:23am on 01/03/2011 under
Is it a bug that while (GNU) tar -cjf foo.tar.bz2 creates foo.tar.bz2, tar -cjf user@host.name.fqdn:/path/to/foo.tar.bz2 won't create /path/to/foo.tar.bz2 on the target host, instead failing with ENOENT, or merely a bug in the man-page that it doesn't mention this fact?

ETA: Please Switch NoBoydie, those of you to whom that means something...
There are 22 comments on this entry. (Reply.)
 
posted by [identity profile] 3c66b.livejournal.com at 08:31am on 01/03/2011
No. It's not a bug, it's missing functionality. Try tar cjf - ... | ssh user@host.name cat > /path/to/wherever.tar.bz2...
emperor: (Default)
posted by [personal profile] emperor at 08:40am on 01/03/2011
touch /path/to/foo.tar.bz2 before invoking tar works too, AFAICT
simont: A picture of me in 2016 (Default)
posted by [personal profile] simont at 09:00am on 01/03/2011
Wait, you mean that tar will connect to a remote host by unspecified means, and is only foiled by the nonexistence of the file on that host? Or have I misunderstood?

I would say that the failure to transparently create a file on a remote host can only be seen as a bug in tar if you're also willing to see it as a bug in absolutely all other Unix programs which take pathnames on their command lines (from cat to oowriter), i.e. essentially extend the Unix pathname format to include a syntax for specifying remote file access, and arrange to be able to support that syntax universally (err, somehow - probably by putting more cleverness in libc).

VMS does do this, but Unix never has done, and it would seem odd for tar in particular to be singled out if you're unhappy with the latter.
emperor: (Default)
posted by [personal profile] emperor at 09:15am on 01/03/2011
GNU tar uses rsh or something else if you specify e.g. --rsh-command=/usr/bin/ssh
simont: A picture of me in 2016 (Default)
posted by [personal profile] simont at 09:20am on 01/03/2011
Hmm, yes, I now see --rsh-command in the man page, but oddly I can still find no text about what it's for or what syntax you should use to invoke it. Presumably that's just because GNU in their unbounded wisdom put all that in the info file instead :-(

I still say it's odd to single out tar from all the other Unix programs that might usefully do transparent remote file access, but now it's odd of GNU rather than of you :-)
toothycat: (Default)
posted by [personal profile] toothycat at 09:22am on 01/03/2011
Whatever happened to "Make each program do one thing well", anyway?
 
posted by [identity profile] hoiho.livejournal.com at 02:02pm on 01/03/2011
Berkley.

"cat came back from Berkeley waving flags" — Rob Pike
fanf: (Default)
posted by [personal profile] fanf at 09:49am on 01/03/2011
The //host/path syntax was used by the Unix variant Domain/OS, which is where the special get-out for // in POSIX comes from. I am not sure if this was the basis of the URL syntax, nor am I sure how it relates to the Windows Universal Naming Convention of \\host\share\path.
 
posted by [identity profile] hoiho.livejournal.com at 02:09pm on 01/03/2011
I always preferred the Newcastle Connection, which used the /../host/user/path syntax. I only ever saw it running on PNX (Perq), and 4.2Nix (Whitechapel) hosts.

pm215: (Default)
posted by [personal profile] pm215 at 08:06pm on 01/03/2011
Mmm. I have one machine which can talk Newcastle Connection, which is a bit useless really...

(ICL 3300, aka the PERQ3a.)
 
posted by [identity profile] hoiho.livejournal.com at 09:20pm on 01/03/2011
Back when I collected PERQs (yes, really), a PERQ3 was the only one I never managed to acquire. Not that it was morally a PERQ, though, what with not having bit-sliced CPU, or accessible microprogramming.
pm215: (Default)
posted by [personal profile] pm215 at 09:33pm on 01/03/2011
Yeah, I have a PERQ1 with the 16K microcode store too. I really must get round to seeing if it still boots; it's been a decade since I last tried it I think...
 
posted by [identity profile] 3c66b.livejournal.com at 09:06am on 01/03/2011
OK, apologies, I see it is meant to do this (with --rsh-command=/usr/bin/ssh). Shouldn't do technical stuff before breakfast.

Doesn't work for me, though (Debian squeeze): and the big advantage of piping through ssh is that you know exactly what it's doing...
toothycat: (Default)
posted by [personal profile] toothycat at 08:40am on 01/03/2011
I confess I'm mildly surprised it doesn't create the path user@host.name.fqdn:/path/to/foo.tar.bz2 on the local host. tar has moved on since I last read the man page.
Edited Date: 2011-03-01 08:41 am (UTC)
simont: A picture of me in 2016 (Default)
posted by [personal profile] simont at 09:05am on 01/03/2011
Isn't that just because the directory user@host.name.fqdn:/path/to doesn't already exist?
ext_8103: (Default)
posted by [identity profile] ewx.livejournal.com at 09:10am on 01/03/2011

It works just fine, at least with squeeze or better at each end.

richard@araminta:~$ ssh deodand ls -l /home/richard/foo.tar.bz2
ls: cannot access /home/richard/foo.tar.bz2: No such file or directory
richard@araminta:~$ tar cjf deodand:/home/richard/foo.tar.bz2 foo.java
richard@araminta:~$ 

With lenny at the receiving end it just hangs for me (and I don't have time to figure out why right now).

Perhaps you've omitted some aspect of what you're trying to do from your description.

emperor: (Default)
posted by [personal profile] emperor at 09:16am on 01/03/2011
The remote end is an OSX box. strace showed that tar calls /usr/sbin/rmt on the far end, and that complains that the file doesn't exist (AFAICT from trying to see what was going on by looking at strace output at 2am).
ext_8103: (Default)
posted by [identity profile] ewx.livejournal.com at 09:29am on 01/03/2011
chymax$ uname -s
Darwin
chymax$ ls -l /usr/sbin/rmt
ls: /usr/sbin/rmt: No such file or directory
emperor: (Default)
posted by [personal profile] emperor at 10:42am on 01/03/2011
Huh. This is a colleague's machine I'm copying to, so I'm not sure what they've installed on it, but...

hill60:~ matthew$ uname
Darwin
hill60:~ matthew$ ls -l /usr/sbin/rmt 
-r-xr-xr-x  1 root  wheel  38736 Dec  9  2008 /usr/sbin/rmt
ext_8103: (Default)
posted by [identity profile] ewx.livejournal.com at 11:09am on 01/03/2011
Perhaps they have a later OSX. At any rate, using a (correctly quoted!) version of 3c66b's rune seems like the answer.
 
posted by [identity profile] stephdairy.livejournal.com at 10:43am on 01/03/2011
Wow. rmt. There's a blast from the past. (And indeed from OSX's past, as it turns out - it looks like it was in 10.5 but doesn't seem to be in 10.6.)

I like its manpage:

BUGS
People should be discouraged from using this for a remote file access protocol.

(S)
ext_243: (rock star)
posted by [identity profile] xlerb.livejournal.com at 05:59am on 02/03/2011
Wow. I don't think I've ever seen the rmt syntax in the wild. (And certainly not combined with bzip2.)

August

SunMonTueWedThuFriSat
          1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10 11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31