A package to safely copy files from one place to another
composer require dbseller/safe-copy
$safeCopy = new \DBSeller\SafeCopy\SafeCopy("/path/from", "/path/to");
// @throws Exception on error
$safeCopy->execute();
vendor/bin/safe-copy /path/from /path/to