Copy and move working with nested paths

Updated the script so that the copy function does not have to be in the
same folder on the server as the files anymore.