Thank you David and Thomas,
David is right about the fact that it would be better if the script could retrieve the backup from the remote machine, but just in order to make things simpler we can do the transfer by SST:
http://www.jazarsoft.com/product.php?pid=0090040006
so perhaps if a php coder is going to help, things will be simpler for him, or maybe someone can combine the two pieces of code and make a perfect solution that does the transfer as well