[Bug 13587] New: Add a --dry-run way to show destination for each item

Francis.Montagnac at inria.fr Francis.Montagnac at inria.fr
Wed Aug 22 07:42:54 UTC 2018


Hi (sorry to only answer to the list)

On Tue, 21 Aug 2018 23:03:56 -0000 just subscribed for rsync-qa from bugzilla via rsync wrote:

> User very much wants to know where the files _will go_ before daring to try an
> actual run.

> He tries even
> rsync -vv --dry-run --itemize-changes -avz x.y.z:dir1/dir2/backup/ backup/

> but still there is no way to make it say
> File x.y.z:dir1/dir2/backup/F1 will be copied to backup/F1
> File x.y.z:dir1/dir2/backup/F2 will be copied to backup/F2

What about that:

  with this hierarchy:

    find dir1 dir3
    dir1
    dir1/dir2
    dir1/dir2/backup
    dir1/dir2/backup/subdir
    dir1/dir2/backup/subdir/F3
    dir1/dir2/backup/F2
    dir1/dir2/backup/F1
    dir3
    dir3/backup
    dir3/backup/F4

  one may say, for two source directories:

    rsync --dry-run --out-format='%i %f -> %n%L' -a dir1/dir2/backup/ dir3/backup/ backup/
    cd+++++++++ dir1/dir2/backup/. -> ./
    >f+++++++++ dir1/dir2/backup/F1 -> F1
    >f+++++++++ dir1/dir2/backup/F2 -> F2
    >f+++++++++ dir3/backup/F4 -> F4
    cd+++++++++ dir1/dir2/backup/subdir -> subdir/
    >f+++++++++ dir1/dir2/backup/subdir/F3 -> subdir/F3

Ref: man rsyncd.conf: log format

 %i an itemized list of what is being updated
 %f the filename (long form on sender; no trailing "/")
 %n the filename (short form; trailing "/" on dir)

-- 
francis



More information about the rsync mailing list