Linux has gradually become the third-largest server operating system and the main competitor of Microsoft in the low-end server market. One of the reasons is the security performance of Linux, and the other is the cost. The following describes how to copy files in Rsync.
If you need to perform an automatic backup operation or deploy a security policy, rsync is definitely a good choice for either a single workstation or all servers and workstations in a network. It can report all incidents in a timely manner, especially when it is used with other suitable tools, it can greatly improve the security protection performance.
Rsync is designed as a simple file copy tool, but unlike other copy tools such as cp and rcp, rsync outperforms them in terms of functionality. Because rsync has the verification and comparison function, you can determine which file needs to be copied and which file already exists on the target machine without copying. For example, to copy a directory containing 30 files on the foo computer to the bar machine, if cp is selected, only files are copied, and overwrite the files with the same file name on the bar machine. Some files may have been copied from foo to the bar. However, if rsync is selected, it will quickly compare the same directory on foo and bar and view the difference between the two, finally, copy the files that exist on foo but do not exist on bar to the bar without copying duplicate files. This will greatly save the total time spent on copying files, especially when you need to back up data on a machine to another machine. Rsync is easy to use and can enhance operation security if used properly. In addition, it can also be used as a security detection tool, without the support of any other software, you can complete the Integrity audit of the file system.
File copy Function
Data security generally requires backing up key data. It can be solved by following the example of a small business. For example, on every workstation in the office, important files can be recorded on a CD, this is faster than running some automatic backup software on the network. The most effective method is of course to regularly copy the files to be backed up to the hard disk of the backup server through the network using the low-cost Backup Server with high-speed hard disk. For those units with relatively large office tasks, an old-fashioned computer can be called to assume the role of the backup server, which is extremely simple, copy important data files to complete the backup during the time period when no one is using the network, such as midnight or weekend. Rsync is a simple process for copying files between computing machines over the network. If the file to be copied is on a Linux system, there is an extremely simple method. You only need to enter the following command on the target Linux system:
Rsync localdir host: remotedir
The preceding command line uses rsync as the default operation. On the local system (localdir), specify the directory to be copied and the host Name of the remote system) and remotedir ). For example, if you want to copy the/home/baz directory on the foo system to the/home/backup/qux directory on the host bar, the key-in command is:
Rsync/home/baz bar:/home/backup/qux