InfoHeap
Tech tutorials, tips, tools and more
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Rsync tutorials

  • Linux rsync tutorial
  • Custom identity file with rsync
  • Exclude a file extension
  • Rsync - show progress and transfer rate
  • Using dryrun to list changed files
  • Using rsync for production release automation
 
  • Home
  • > Tutorials
  • > Linux/Unix Command Line
  • > Rsync

Linux rsync tutorial

By admin on Sep 15, 2015

Rsync is a great tool to copy and sync directories and files across computers. It can also be used to manage source code and data on production machines or take backup of files and directories. This article will use Ubuntu Linux but rsync can run on other operating systems also.

Here are some common use cases to use rsync:

Basic archive rsync

This is most widely used option. It is quick way to specify that you want recursion and want to preserver almost everything.

$ rsync -azv ./src ./dest/

Note that ./dest/ is a directory and this will create src folder inside it, if it does not exist. Option -v is to add verbosity and -z is to enable compression.
The files are transferred in “archive” mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer.

skip files that are newer on the receiver

This is very useful option in case you want to rsync only if files are newer on local system.

$ rsync --update -azv ./src ./dest/

delete extraneous files from dest dirs

This option must be used with caution. Avoid if possible.

$ rsync --delete --update -azv ./src ./dest/

rsync with dryrun

To run rsycn with dryrun:

$ rsync --dry-run -azv ./src ./dest/

Note that rsync by default check file size and timestamp on source an destination to decide if it should transfer the file. This can be changed with –checksum option which will cause it to check for checksum for all files.

Suggested posts:

  1. Gulp quick start tutorial
  2. Bash – how to compare file timestamps
  3. Ubuntu – how to find boot autostart status of a service
  4. Edit a file without changing its timestamp on Linux
  5. How to use custom identity file with rsync on Linux
  6. Rsync – using dryrun to list changed files
  7. Rsync – show progress and transfer rate
  8. Rsync – exclude specific file extension
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Linux/Unix Command Line, Rsync, Tutorials, Ubuntu Linux

Follow InfoHeap

facebook
twitter
googleplus
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries

Copyright © 2022 InfoHeap.

Powered by WordPress