sync before cp

Synchronise the logfile before `cp`