[Nepomuk] Re: sopranocmd export stdout
Matthew Dawson
matthew at mjdsystems.ca
Wed Mar 23 07:05:05 CET 2011
On Tuesday 22 March 2011 19:55:10 Ben Martin wrote:
> Hi,
> I've been using sopranocmd to export an RDF database for archival
> purposes. Unfortunately, you can get some rather large files using
> export. Luckily, they compress really well too.
>
> I haven't been able to convince sopranocmd to export to stdout so I
> can bzip2 compress its output without it hitting disk. Using "-" as the
> file name creates a file called "-" and writes to it. And trying to be
> trickier fails too, perhaps because the file is opened read/write?
>
> $ sopranocmd --backend redland export /proc/self/fd/1
> Could not open file for writing: /proc/self/fd/1
>
> Thoughts || willingness to accept patches to make this work like above?
>
>
Hey,
You could try the follow bashism (I can't try it right now with sopranocmd as I haven't played with the command):
sopranocmd --backend redland export >(bzip2 >file.bz2)
Anything you put between the ()'s bash will execute, redirecting the input as appropriate. Note that it uses the fd's as well, but it uses them from /dev/fd/*.
Hope that helps,
Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20110323/2bfa853f/attachment.sig
More information about the Nepomuk
mailing list