1.SCP Transmission
SCP -r/data/file [email protected]:/data/SCP -c/data/sda.img [email protected]:/data/img/
#-r: Support Directory
#-c: Enable compression transfer
SCP transfer is slow, but the security of the transmission is ensured by using SSH Channel
2.rsync differential Transmission (support for breakpoint continuation, data synchronization)
rsync-av/backup/-ESSH[Email protected]192.168.1.110:/Bak#-a:archive archive mode, which means to transfer files recursively, and keep all file attributes, links, etc., equal to-Rlptgodrsync--remoteSync. Rsync is a file synchronization and data Transfer tool under the Linux system that uses the "rsync" algorithm to synchronize files between a client and a remote file server, or to back up data from one partition to another on the local system. If Rsync has a data transfer interruption during the backup process, it can continue to transmit the inconsistent portions after recovery. Rsync can perform full or incremental backups. Its main features are:1can be mirrored to save the entire directory tree and file system;2can be easily done to maintain the original file permissions, time, soft and hard links, without special permission to install;3the data can be incrementally synchronized, the file transfer efficiency is high, so the synchronization time is short;4can use RCP, ssh and other means to transfer files, of course, you can also through the direct socket connection;5support anonymous transmission, in order to facilitate the site mirror image, etc.;6Encrypted transmission of data to ensure the security of the data;
3. Pipeline transmission (reduced IO overhead)
gzip SSH [Email protected] 192.168. 1.110 " gunzip-c->/image/sda.img "
#对sda. IMG uses gzip compression, the-c parameter indicates output to STDOUT, which is routed through the pipeline
#gunzip-C-"-" means receiving a sdtin from a pipe
4.NC Transmission (data flow redirection for a network)
What NC does is to establish a TCP or UDP link between the two computers and transfer traffic between the two ports, which is a network traffic redirection
#使用dd结合nc命令网络克隆磁盘分区主机: DD if gzip 50522 192.168. 215.63 50522 gzip DD OF=/DEV/SDA
#dd命令克隆/dev/vda disk, and use gzip compression, redirect the data stream to the native 50522 port, to restore the machine using NC connection host 50522 port, you can receive the host 50522 port of the bit data stream, then use gzip decompression, and revert to/dev/ SDA disk
#dd命令读取的是磁盘扇区, so regardless of disk file system, or partition table, disk MBR information, DD can be copied, use the Bs,count parameter to control the size to be cloned
#例如dd bs=512 count=1 If=/dev/vda of=mbr.img Copy only the first sector of the disk VDA 512K byte data (bootstrapper and partition Table)
5. Create a file server
In addition to the way in which files are transferred centrally, it can also be transmitted via a resume file server and then via a network mount, this applies to regular copies, and below is an example of mounting an FTP server.
mount the FTP server Yum Install Curlftpfs mkdir /data/ftp/data/ftp
Comparison of centralized methods for transferring files between Linux hosts