Hello !
How can i rsync two folders over the web page ?
What is the command . Only in php or java.
Thanks !
How to sync folders
Moderator: General Moderators
This would be a start. Then you could just apply the basic file copy functions within the if-then-else statement of choise...
Result:
Code: Select all
<?php
$dir1 = './1/';
$dir2 = './2/';
$arr1 = glob($dir1.'*');
$arr2 = glob($dir2.'*');
print_r($arr1); // debugging to...
print_r($arr2); // ...show example output.
foreach($arr1 as $file) {
echo $file .' : '. filemtime($file) .'<br />';
}
foreach($arr2 as $file) {
echo $file .' : '. filemtime($file) .'<br />';
}
?>Code: Select all
Array
(
ї0] => ./1/10b.txt
)
Array
(
ї0] => ./2/10b.txt
ї1] => ./2/alone.txt
)
./1/10b.txt : 1117275238
./2/10b.txt : 1117274932
./2/alone.txt : 1117275000A little sample if you want to sync over ftp
http://timvw.madoka.be/comment.php?message_id=178
But you have asked this question already a few times, and my answer remains the same: Use the right tool for the right job. There are already a zillion of tools to sync (fe: rsync) that are specialized to do this... It would be silly to not use them.
http://timvw.madoka.be/comment.php?message_id=178
But you have asked this question already a few times, and my answer remains the same: Use the right tool for the right job. There are already a zillion of tools to sync (fe: rsync) that are specialized to do this... It would be silly to not use them.