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

Dave Gradwell davegradwell at yahoo.co.uk
Sat Aug 30 04:36:00 MDT 2014


Hi, 

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 [62154] 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:
RSYNC_ARG1=--server
RSYNC_ARG2=-nltrRze.iLsfx
RSYNC_ARG3=--log-format=X
RSYNC_ARG4=--bwlimit=256
RSYNC_ARG5=--delete-during
RSYNC_ARG6=--delete-excluded
RSYNC_ARG7=--force
RSYNC_ARG8=--partial-dir
RSYNC_ARG9=/in-progress/partial
RSYNC_ARG10=--link-dest
RSYNC_ARG11=/latest/data
RSYNC_ARG12=--info=STATS2
RSYNC_ARG13=--debug=EXIT
RSYNC_ARG14=.
RSYNC_ARG15=/in-progress/data/

I'm on Mac OS 10.9, using rsync 3.1.1.

Thanks, Dave.









More information about the rsync mailing list