script copy to output and logging