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

How to use custom identity file with rsync on Linux

By admin on Sep 11, 2015

Rsync uses ssh to sync files between two machines and usually it will use default identity file present in ~/.ssh/ directory on Linux. In case you want to use a custom rsync file you can use -e or –rsh option of rsync. Another option is to change ~/.ssh/config file to specify identity file for a specific host. For this article we will be using Ubuntu Linux.

To use specific identity file using -e, use the following command:

rsync -v -az --exclude="_norsync*" -e "ssh -l USERID -i /idfilepath/id_rsa" /srcpath DESTHOST:/destpath/

You can replace DESTHOST and USERID appropriately.

Other approach is to add the following entry in ~/.ssh/config

host DESTHOST
  IdentityFile /idfilepath/id_rsa

You can replace DESTHOST, idfilepath and USERID appropriately. This tell ssh that for DESTHOST use the specified identity file.

Suggested posts:

  1. How to log page latency and url host in apache log
  2. How to install drupal on Mac usin MAMP
  3. Git – show log of one user’s commits
  4. Linux/Unix – find inode number of a file
  5. Linux file timestamps
  6. Java – array for-each loop
  7. How to locally override website domain (or hostname) to IP mapping
  8. WordPress – how to add filter to description meta tag
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