Why use dry run with rsync?

Using a dry run with rsync is helpful for several reasons:

  1. Preview Changes: The --dry-run option allows you to see what files would be copied, deleted, or updated without actually making any changes. This helps you verify the command's behavior before executing it.

  2. Avoid Mistakes: It helps prevent accidental data loss or overwriting files. By reviewing the output first, you can ensure that the correct files are being targeted.

  3. Plan Transfers: You can assess the amount of data that will be transferred, which is useful for managing bandwidth and storage.

  4. Debugging: If you're unsure about your rsync command, a dry run can help identify issues in your command syntax or logic.

To perform a dry run, you can use the following command:

rsync -av --dry-run source/ destination/

This will show you what would happen without actually transferring any files. If you have more questions or need further assistance, feel free to ask!

0 Comments

no data
Be the first to share your comment!