Batch mode scenario ("use case")

Chris Shoemaker c.shoemaker at
Mon Sep 10 00:15:40 GMT 2007

On Sun, Sep 09, 2007 at 11:17:05PM +0000, Suresh Govindachar wrote:
>   Responding to the question of how to use the batch file 
>   /e/cmds/foo created via the command:
>   > rsync -a --only-write-batch=/e/cmds/foo /c/home/wer/work/ /e/gold
>   to selectively restore a subdirectory of work/ such as 
>           some/path/projects/c_a 
>   into a new location such as  
>          /f/new_home/wer/work
>   which has a copy of some/path/projects/c_a gotten from /e/gold but
>   is otherwise empty, Matt wrote:
>   > Rsync currently doesn't provide a good way to do this.  It would
>   > be great if sender filters could be used to control which
>   > file-list entries from the batch file are processed.  For now, a
>   > hackish way to quickly recover a subdirectory is to --read-batch
>   > to a destination that has been set up specially so that the user
>   > cannot write to anything in the destination except the
>   > subdirectory to be recovered.
>   Is there a specification for the format of the batch file?  

The batch file format is simply a dump of rsync's network protocol.
That way, replaying the batch file is quite similar to performing the
original sync, except for the bytes come from the file instead of from
the socket.

At least, that's the way it worked last time I looked, which was
several years ago.


>   Might
>   it be possible to write a script to read /e/cmds/foo and create a
>   new batch file that would correspond to having been created while
>   rsync'ing --only-write-batch of work/<path>/c_a with gold/<path>/c_a?
>   Thanks,
>   --Suresh
> -- 
> To unsubscribe or change options:
> Before posting, read:

More information about the rsync mailing list