Using rsync to sync files rsync avh source…

Using rsync to sync files.

rsync -avh source_folder/ target_folder/
  • -a: archive mode
  • -v: verbose
  • -h: human readable

Additional options

  • -u: update only (preserve newer files)
  • -H: preserve the hard link
  • –progress: shows progress
  • -n: dry run (without actual copying)

By the way, “/home/user/dir/” and “/home/usr/dir” are not the same thing to rsync. Without the final slash, rsync will copy the directory in its entirety. With the trailing slash, it will copy the contents of the directory but won’t recreate the directory.

For more explanations, check this nice post.

By microbe

Like to cook for microorganisms and human. Play football, tennis, and baseball.

Leave a Reply

Your email address will not be published. Required fields are marked *