Cleanest way to find out if it was a --dry-run

Wayne Davison wayned at samba.org
Sat Aug 30 12:20:20 MDT 2014


On Sat, Aug 30, 2014 at 3:36 AM, Dave Gradwell <davegradwell at yahoo.co.uk>
wrote:

> As far as I can see, the only way you can tell it's been a dry-run at the
> receiver-side, is to parse RSYNC_ARGs in the pre-xfer script.
>

It's not clear what you mean, whether you're talking about only a daemon,
or a client message or what.  If you have transfer logging enabled in a
daemon, only non-dry-run files will be logged as transfers.  If you're
talking about a client, you can always use --info=stats (or --stats on an
older rsync) to see the trailing stats lines that mentions "(DRY RUN)".

If you end up parsing args in a pre-xfer script, be sure to weed out any
arg-specifying short options from your checking for the -n arg (e.g.
/^-[^BefMT]*n/) and some non-official passing of the long (--dry-run)
option as well.

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140830/2a384495/attachment.html>


More information about the rsync mailing list