What @halfer is suggesting is this (I just modified your potential solution based on his idea) so he should take credit:
upload($dirtocopy.$entry, $dropboxdir.$entry);
}
}
}
closedir($handle);
}
}
// Dropbox username/password
$dropbox_email='dropbox@dropbox.com';
$dropbox_pass='password';
// File to backup
$siteroot = "./";
include("DropboxUploader.php");
$uploader = new DropboxUploader($dropbox_email, $dropbox_pass);
uploadx($siteroot, 'Backup/Files/', $uploader);
?>
BTW, the function above is from here: How to backup files from a specific directory to Dropbox using PHP only?