Cleanest way to find out if it was a --dry-run
davegradwell at yahoo.co.uk
Sat Aug 30 04:36:00 MDT 2014
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.
I think the only way is to crawl through the RSYNC_ARGs to find a value which:
- starts with a single dash, and;
- contains 'n', and;
- comes prior to the "." value, signifying the start of the 'path args' (which seem inherently variable, ergo scary).
I can't see any other way to determine that it's been a dry run. On the sender-side, the log contains a handy (DRY RUN) indicator next to the stats:
2014/08/29 18:54:15  total size is 327,680,000 speedup is 68,739.25 (DRY RUN)
but I don't think you can output stats at the receiver-side, and I don't think there's any other mention of the dry run in the receiver-side log.
In my pre-xfer script, I see this:
I'm on Mac OS 10.9, using rsync 3.1.1.
More information about the rsync