You will need to use a PHP function to copy the file. Something like this.
Description
bool copy ( string source, string dest)
Example :
<?php
if (!copy($file, $file.'.bak')) {
echo "failed to copy $file...<br />\n";
}
?>
In order to run the code on entrance, use a JavaScript.