move copytoserver to external script to ensure serial execution