rsync in php

rsync in php

rsync in php :
rsync allows to transfer just the differences between two sets of files across the network connection, using an efficient checksum-search algorithm. It copies files either to or from a remote host, or locally. There are two different ways for rsync to contact a remote system: using a remote-shell program as the transport (such as ssh or rsh) or contacting an rsync daemon directly via TCP. We can run rsync using exec function in PHP.

Syntax:
exec(”rsync [option] [src] [Destination]”);

Example:
<?php
/****** To copy files from folder2 to folder1 ***********/
exec(”rsync -a user@server:folder2/ folder1″);
?>

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.