#6 Capture rsync output
Closed: Fixed None Opened 7 years ago by tibbs.

In order to do useful things, we need to capture rsync output. So... capture rsync output.

It could be useful to timestamp the output, but we can't assume that 'ts' is available. This snippet will do it, but...

command | while IFS= read -r line; do printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done

stderr and stdout are now captured at the appropriate debugging levels. The code doesn't do anything with them yet, though.

Login to comment on this ticket.

Metadata