InfoHeap
Tech
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. Linux/Unix – find inode number of a file
  2. Custom terminal tab title and ssh on mac
  3. How to log page latency and url host in apache log
  4. Mysql – how to copy a table
  5. PHP – How to log custom data in apache access log
  6. Gmail – how to find large size emails
  7. Gulp quick start tutorial
  8. Linux file timestamps
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
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | 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 | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress