tar: Failed to open '/dev/sa0'

David Christensen dpchrist at holgerdanske.com
Sun Jun 18 20:37:24 UTC 2017


On 06/18/17 13:21, Solène Rapenne wrote:
> Je 2017-06-18 20:59, David Christensen skribis:
>> 2017-06-18 11:53:14 dpchrist at freebsd ~
>> $ tar c .thunderbird > dpchrist-thunderbird-20170618.tar
>> tar: Failed to open '/dev/sa0'
> I think the syntax should be
>
> tar cf - .thunderbird > output.tar
>
> or
>
> tar cf output.tar .thunderbird
>
> /dev/sd0 is a tape device IIRC, tar assume you want to save to a tape
> by default, that's why you have to use the f flag (to a file or to
> standard output)

Yes -- thank you:

2017-06-18 13:31:20 dpchrist at freebsd ~
$ tar cf - .thunderbird > output.tar

2017-06-18 13:31:37 dpchrist at freebsd ~
$ gtar cf - .thunderbird > output.gtar

2017-06-18 13:31:52 dpchrist at freebsd ~
$ ls -l output.*
-rw-r--r--  1 dpchrist  dpchrist  223703040 Jun 18 13:31 output.gtar
-rw-r--r--  1 dpchrist  dpchrist  223119360 Jun 18 13:31 output.tar


I STFW yesterday, found that solution, and thought I had tried it.  But, 
the tar command is issued over SSH by a Perl script running on another 
machine with the output piped to that other machine, so I must have 
confused myself with too many levels of indirection....


David



More information about the freebsd-questions mailing list