new option suggestion '--backup-only'

jw schultz jw at
Fri Sep 5 18:10:54 EST 2003

On Fri, Sep 05, 2003 at 04:02:11PM +0900, Takeru KOMORIYA wrote:
> Hi,
> How about adding now option '--backup-only'  that means making backups
> only and don't change any destination files?
> (I posted similar patch a month ago, but the patch was made for
>  nightly snapshot of 20020808, which was tooo old! Laugh at me...)
> I want to use rsync with LVM snapshot to make incremental backups like
> below:
>   1) Make LVM snapshot of file system and mount it.
>   2) Compare it to yesterday's snapshot, and backup files which are
>      updated or deleted.
>      ex) rsync -a --delete --backup --backup-dir=/backup/backup_on_$DATE
>   3) Delete yesterday's snapshot.
> The problem is that LVM snapshots are read-only, so I need rsync not
> to modefy any destination files.
> I made trial patch against latest CVS, and this works fine for me.
> With this patch, new options '--backup-only' is added, and the
> '--backup-dir' option implies '--backup' for convinience.

Let's see if i understand what you are talking about.
The LVM stuff about snapshots and today vs. yesterday is
snow so i'll eliminate it.  What i describe is partly based
on your description of this as an extension of --backup that
doesn't change the "destination".

You want to compare tree A with tree B and for those files
that differ copy from tree B to an empty backup tree (tree C)
with no change to trees A or B.  The result being that tree
C is a sparse tree (a characteristic of --backup-dir).

If all are trees are local this would amount to
	rsync -a --compare-dest=$tree_A $tree_B $tree_C

More information about the rsync mailing list