Extracted common parts of 'live' and other tasks.

Also found a bug introduced in commit ca0d137 that stopped 'live' data
being uploaded to services (they'd get the most recent logged data
instead).