--Enter the file names you want to rsync in a text file separated by line breaks --Specify the text file and send it with a single rsync command -** The files you want to rsync must be stored in the same directory. ** **
Enter the file name in /path/to/images.txt (separated by line breaks)
images.txt
file1.png
file2.png
file3.png
$images = '/path/to/images.txt'
$src_path = '/path/to/src/';
$tar_path = '/path/to/tar/';
$rsync_host = 'User name@Destination IP address';
$command = "rsync -av --files-from=".$images." ".$src_path." ".$rsync_host.":".$tar_path;
exec ( $command, $output, $ret );
if($ret == 0) {
return true;
} else {
return false;
}
Recommended Posts