Site icon Bytefreaks.net

How we sync files between two drives

Advertisements

The rsync command is a powerful tool for file synchronization and transfer in Linux and Unix-like operating systems. It provides a robust and efficient way to copy, backup, and mirror files and directories both locally and remotely. In this article, we will explore the technical details of the following rsync command:

rsync -avh --delete --progress "path/to/source/" "path/to/destination/";

We will explain each option and argument used in the command and their respective functionality.

Options and Arguments

The rsync command is a versatile tool with many options and arguments to customize its behavior. The options used in the above command are:

The arguments used in the command are:

Explanation

The rsync command is a powerful tool that synchronizes the source and destination directories or files. The -a option enables the archive mode, which ensures that the file metadata is preserved during the transfer, including permissions, ownership, timestamps, and symbolic links. The -v option enables the verbose mode, which provides detailed output of the rsync operation, including the transferred files and their sizes.

The -h option enables the human-readable mode, which displays file sizes in a more readable format. The –delete option tells rsync to delete any files at the destination that do not exist at the source, which ensures that the destination is an exact copy of the source. Finally, the –progress option displays real-time progress information during the rsync operation, including the percentage of completion and the estimated time remaining.

Conclusion

The rsync command is a powerful tool for file synchronization and transfer in Linux and Unix-like operating systems. The command discussed in this article synchronizes the source and destination directories or files, preserves file metadata, displays detailed output, deletes any files that do not exist at the destination, and displays real-time progress information. With the proper use of rsync options and arguments, file synchronization and transfer can be made easy, efficient, and reliable.

Other

We have two external hard disks that we use to keep backups of our data.
The way we do that is by using the command rsync that makes our life easy.

Specifically, we use the following command to synchronize the first hard disk with the second one: rsync -avh –delete –progress “path/to/source/” “path/to/destination/”;

rsync is a fast, versatile, remote (and local) file-copying tool, it is available in almost every system (GNU/Linux, Unix (MacOS as well) and Windows).

The parameters we use are the following:

This post is also available in: Αγγλικα

Exit mobile version