rsync of STDIN to a file.

Mark Young mark_young at hotmail.com
Wed Nov 25 05:09:44 MST 2009


Hi Matt,

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.

whereas this works:
$ cat r96.exe | rdiff signature > r96.sig


or

works:
$ rdiff delta r96.sig r97.exe r9697.delta

fails:
$ cat r96.sig | rdiff delta - r97.exe r9697.delta
rdiff: unknown option: -
Try `rdiff --help' for more information.

fails:
$ cat r97.exe | rdiff delta r96.sig - r9697.delta
rdiff: unknown option: -
Try `rdiff --help' for more information.

whereas this works:

$ cat r97.exe | rdiff delta r96.sig > r9697.delta



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"


All the best,
Cheers,
Mark


From: mark_young at hotmail.com
To: rsync at lists.samba.org
Subject: RE: rsync of STDIN to a file.
Date: Tue, 24 Nov 2009 14:38:31 +0000








Thanks very much Matt for the rdiff command examples and for filing a request to improve the documentation.

Cheers,
Mark

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20091125/133312ee/attachment.html>


More information about the rsync mailing list