rsync of STDIN to a file.

Matt McCutchen matt at mattmccutchen.net
Fri Nov 27 22:51:24 MST 2009


On Wed, 2009-11-25 at 12:09 +0000, Mark Young wrote:
> I believe the rdiff man page is still not correct, even with your
> submitted changes. It states "In every case where a filename must be
> specified, - may be used instead to mean either standard input or
> standard output as appropriate.".
> 
> I've not found that to be the case. For instance:
> 
> works:
> $ rdiff signature r96.exe r96.sig
> 
> fails:
> $ cat r96.exe | rdiff signature - r96.sig
> rdiff: unknown option: -
> Try `rdiff --help' for more information.

The next sentence of the man page says, "Be aware that if you do this,
you’ll need to terminate your options with -- or rdiff will think you
are passing it an empty option."  I'll agree that's a really dumb
option-parsing behavior, but it is properly documented.  You can enter
an upstream bug to have it changed if you like.

> So in the case of my remote backup script I can achieve my desired
> result by relying on the implied STDIN and redirecting STDOUT, which
> is fine for me, but it doesn't match the description in the man page.
> FYI these are the four commands I've created to achieve my backup
> without storing the backup file locally. Given a backup output file of
> backup_Wed.tgz, which is due to overwrite last weeks backup_Wed.tgz on
> the remote system:
> 
> $ ssh user at remote_host "rdiff signature backup_Wed.tgz" >
> oldbackup.sig
> $ tar czf - /home | rdiff delta oldbackup.sig > backup.delta
> $ cat backup.delta | ssh user at remote_host "rdiff patch backup_Wed.tgz
> > backup_Wed.tgz.new"
> $ ssh user at remote_host "mv backup_Wed.tgz.new backup_Wed.tgz"

I'm glad to hear that it's working.

-- 
Matt



More information about the rsync mailing list