<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eocakovs</id>
	<title>ICO wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eocakovs"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php/Special:Contributions/Eocakovs"/>
	<updated>2026-05-05T20:48:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122968</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122968"/>
		<updated>2017-05-26T04:56:53Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Prototype */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Value Chain Analysis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IT SWOT==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no direct competitors&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organised and motivated&lt;br /&gt;
| Small company, not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer skepticism - might not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
==User Stories==&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Flow Diagrams==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE1.png |1240px|]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
[[File:Architectural_model_WPE.png |800px|]]&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
The main goal is to create an application that would be easily operated by the end user.&lt;br /&gt;
Since the application is mainly meant for the average home user, it cannot require any specific knowledge about computers, or computer related terminology.&lt;br /&gt;
All aformentioned points (additionally see non-functional requirements) need to be kept in mind when designing the UI. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measurable Key Performance Indicators&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Success rate (how many of the user requests come back with a positive responce. i.e. - if a user requests for additional app info, can we provide that information, or will the user get back nothing).&lt;br /&gt;
* Time on task (e.g. how long does it take for the user to upgrade from standard user to premium user. Does it take too much time, and is the process too complicated).&lt;br /&gt;
* Amount of installations.&lt;br /&gt;
* Time user spends in app (active time).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User feedback&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In-app feedback tab (option to select how satisfied the user is with the program in a 1-10 point scale, and a comment box)&lt;br /&gt;
* Post service survey. For instance after a user upgrades from standard user to premium user, an email will be sent out with questions about the process and an option to leave feedback and suggestions.&lt;br /&gt;
* Email survey. An email will be sent out with a user satisfaction survey, asking users to rate different parts of the process.&lt;br /&gt;
* In-app survey before uninstalling/downgrading the WPE (With in-app monetary incentive).&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
* Competitors (like &#039;Revo uninstaller&#039; / Windows native Store)&lt;br /&gt;
* Investors / Venture Capital&lt;br /&gt;
* Performance (DB / Network / Program Design)&lt;br /&gt;
* Balance of team (developers vs testers)&lt;br /&gt;
* Time&lt;br /&gt;
* Unforseeable constraints we have to deal with using Agile Approach&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Hackers and data Breaches&lt;br /&gt;
! Hardware failure&lt;br /&gt;
! Power outages&lt;br /&gt;
! Force majeures&lt;br /&gt;
! Software Issues&lt;br /&gt;
! User errors&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
* Secure software practices&lt;br /&gt;
* Secure network architecture&lt;br /&gt;
* Inhouse team training&lt;br /&gt;
| &lt;br /&gt;
* Backup hardware&lt;br /&gt;
* Cloud / Off-site duplication&lt;br /&gt;
| &lt;br /&gt;
* UPS&lt;br /&gt;
* Power generators&lt;br /&gt;
* Backup servers&lt;br /&gt;
| &lt;br /&gt;
* Correct contracts with customer&lt;br /&gt;
| &lt;br /&gt;
* Increase hiring requirements&lt;br /&gt;
* Hire Testers / Debuggers&lt;br /&gt;
* Educate current developers&lt;br /&gt;
|&lt;br /&gt;
* Create intuitive user experience&lt;br /&gt;
|}&lt;br /&gt;
==Prototype==&lt;br /&gt;
[[File:Prototype_wpe.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;br /&gt;
Our group identified a need for an information system that would explain to users applications that either are or could be installed. However after careful analysis we have to come to the conclusion that the application will become obsolete due to an increasing push by Microsoft for Windows 10+ and their native Store. For this application to have a future it should integrate with the native Windows store. Therefore we do not proceed to full development and await further action by Microsoft until project becomes viable. &lt;br /&gt;
&lt;br /&gt;
It is suitable for agile since we can identify Minimum Viable Product requirements&lt;br /&gt;
but due to constantly evolving application market and Windows platform,&lt;br /&gt;
we cannot create a full analysis which lists all requirements from the beginning.&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Prototype_wpe.JPG&amp;diff=122967</id>
		<title>File:Prototype wpe.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Prototype_wpe.JPG&amp;diff=122967"/>
		<updated>2017-05-26T04:56:35Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122966</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122966"/>
		<updated>2017-05-26T04:50:57Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* IT SWOT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Value Chain Analysis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IT SWOT==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no direct competitors&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organised and motivated&lt;br /&gt;
| Small company, not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer skepticism - might not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
==User Stories==&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Flow Diagrams==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE1.png |1240px|]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
[[File:Architectural_model_WPE.png |800px|]]&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
The main goal is to create an application that would be easily operated by the end user.&lt;br /&gt;
Since the application is mainly meant for the average home user, it cannot require any specific knowledge about computers, or computer related terminology.&lt;br /&gt;
All aformentioned points (additionally see non-functional requirements) need to be kept in mind when designing the UI. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measurable Key Performance Indicators&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Success rate (how many of the user requests come back with a positive responce. i.e. - if a user requests for additional app info, can we provide that information, or will the user get back nothing).&lt;br /&gt;
* Time on task (e.g. how long does it take for the user to upgrade from standard user to premium user. Does it take too much time, and is the process too complicated).&lt;br /&gt;
* Amount of installations.&lt;br /&gt;
* Time user spends in app (active time).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User feedback&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In-app feedback tab (option to select how satisfied the user is with the program in a 1-10 point scale, and a comment box)&lt;br /&gt;
* Post service survey. For instance after a user upgrades from standard user to premium user, an email will be sent out with questions about the process and an option to leave feedback and suggestions.&lt;br /&gt;
* Email survey. An email will be sent out with a user satisfaction survey, asking users to rate different parts of the process.&lt;br /&gt;
* In-app survey before uninstalling/downgrading the WPE (With in-app monetary incentive).&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
* Competitors (like &#039;Revo uninstaller&#039; / Windows native Store)&lt;br /&gt;
* Investors / Venture Capital&lt;br /&gt;
* Performance (DB / Network / Program Design)&lt;br /&gt;
* Balance of team (developers vs testers)&lt;br /&gt;
* Time&lt;br /&gt;
* Unforseeable constraints we have to deal with using Agile Approach&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Hackers and data Breaches&lt;br /&gt;
! Hardware failure&lt;br /&gt;
! Power outages&lt;br /&gt;
! Force majeures&lt;br /&gt;
! Software Issues&lt;br /&gt;
! User errors&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
* Secure software practices&lt;br /&gt;
* Secure network architecture&lt;br /&gt;
* Inhouse team training&lt;br /&gt;
| &lt;br /&gt;
* Backup hardware&lt;br /&gt;
* Cloud / Off-site duplication&lt;br /&gt;
| &lt;br /&gt;
* UPS&lt;br /&gt;
* Power generators&lt;br /&gt;
* Backup servers&lt;br /&gt;
| &lt;br /&gt;
* Correct contracts with customer&lt;br /&gt;
| &lt;br /&gt;
* Increase hiring requirements&lt;br /&gt;
* Hire Testers / Debuggers&lt;br /&gt;
* Educate current developers&lt;br /&gt;
|&lt;br /&gt;
* Create intuitive user experience&lt;br /&gt;
|}&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;br /&gt;
Our group identified a need for an information system that would explain to users applications that either are or could be installed. However after careful analysis we have to come to the conclusion that the application will become obsolete due to an increasing push by Microsoft for Windows 10+ and their native Store. For this application to have a future it should integrate with the native Windows store. Therefore we do not proceed to full development and await further action by Microsoft until project becomes viable. &lt;br /&gt;
&lt;br /&gt;
It is suitable for agile since we can identify Minimum Viable Product requirements&lt;br /&gt;
but due to constantly evolving application market and Windows platform,&lt;br /&gt;
we cannot create a full analysis which lists all requirements from the beginning.&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122965</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122965"/>
		<updated>2017-05-26T04:49:30Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* IT SWOT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Value Chain Analysis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IT SWOT==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no direct competitors&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized and motivated&lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
==User Stories==&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Flow Diagrams==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE1.png |1240px|]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
[[File:Architectural_model_WPE.png |800px|]]&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
The main goal is to create an application that would be easily operated by the end user.&lt;br /&gt;
Since the application is mainly meant for the average home user, it cannot require any specific knowledge about computers, or computer related terminology.&lt;br /&gt;
All aformentioned points (additionally see non-functional requirements) need to be kept in mind when designing the UI. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measurable Key Performance Indicators&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Success rate (how many of the user requests come back with a positive responce. i.e. - if a user requests for additional app info, can we provide that information, or will the user get back nothing).&lt;br /&gt;
* Time on task (e.g. how long does it take for the user to upgrade from standard user to premium user. Does it take too much time, and is the process too complicated).&lt;br /&gt;
* Amount of installations.&lt;br /&gt;
* Time user spends in app (active time).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User feedback&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In-app feedback tab (option to select how satisfied the user is with the program in a 1-10 point scale, and a comment box)&lt;br /&gt;
* Post service survey. For instance after a user upgrades from standard user to premium user, an email will be sent out with questions about the process and an option to leave feedback and suggestions.&lt;br /&gt;
* Email survey. An email will be sent out with a user satisfaction survey, asking users to rate different parts of the process.&lt;br /&gt;
* In-app survey before uninstalling/downgrading the WPE (With in-app monetary incentive).&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
* Competitors (like &#039;Revo uninstaller&#039; / Windows native Store)&lt;br /&gt;
* Investors / Venture Capital&lt;br /&gt;
* Performance (DB / Network / Program Design)&lt;br /&gt;
* Balance of team (developers vs testers)&lt;br /&gt;
* Time&lt;br /&gt;
* Unforseeable constraints we have to deal with using Agile Approach&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Hackers and data Breaches&lt;br /&gt;
! Hardware failure&lt;br /&gt;
! Power outages&lt;br /&gt;
! Force majeures&lt;br /&gt;
! Software Issues&lt;br /&gt;
! User errors&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
* Secure software practices&lt;br /&gt;
* Secure network architecture&lt;br /&gt;
* Inhouse team training&lt;br /&gt;
| &lt;br /&gt;
* Backup hardware&lt;br /&gt;
* Cloud / Off-site duplication&lt;br /&gt;
| &lt;br /&gt;
* UPS&lt;br /&gt;
* Power generators&lt;br /&gt;
* Backup servers&lt;br /&gt;
| &lt;br /&gt;
* Correct contracts with customer&lt;br /&gt;
| &lt;br /&gt;
* Increase hiring requirements&lt;br /&gt;
* Hire Testers / Debuggers&lt;br /&gt;
* Educate current developers&lt;br /&gt;
|&lt;br /&gt;
* Create intuitive user experience&lt;br /&gt;
|}&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;br /&gt;
Our group identified a need for an information system that would explain to users applications that either are or could be installed. However after careful analysis we have to come to the conclusion that the application will become obsolete due to an increasing push by Microsoft for Windows 10+ and their native Store. For this application to have a future it should integrate with the native Windows store. Therefore we do not proceed to full development and await further action by Microsoft until project becomes viable. &lt;br /&gt;
&lt;br /&gt;
It is suitable for agile since we can identify Minimum Viable Product requirements&lt;br /&gt;
but due to constantly evolving application market and Windows platform,&lt;br /&gt;
we cannot create a full analysis which lists all requirements from the beginning.&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122862</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122862"/>
		<updated>2017-05-25T13:20:19Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Architectural Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Value Chain Analysis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IT SWOT==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
==User Stories==&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Flow Diagrams==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE.png |1240px|]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
[[File:Architectural_model_WPE.png |800px|]]&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
The main goal is to create an application that would be easily operated by the end user.&lt;br /&gt;
Since the application is mainly meant for the average home user, it cannot require any specific knowledge about computers, or computer related terminology.&lt;br /&gt;
All aformentioned points (additionally see non-functional requirements) need to be kept in mind when designing the UI. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measurable Key Performance Indicators&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Success rate (how many of the user requests come back with a positive responce. i.e. - if a user requests for additional app info, can we provide that information, or will the user get back nothing).&lt;br /&gt;
* Time on task (e.g. how long does it take for the user to upgrade from standard user to premium user. Does it take too much time, and is the process too complicated).&lt;br /&gt;
* Amount of installations.&lt;br /&gt;
* Time user spends in app (active time).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User feedback&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In-app feedback tab (option to select how satisfied the user is with the program in a 1-10 point scale, and a comment box)&lt;br /&gt;
* Post service survey. For instance after a user upgrades from standard user to premium user, an email will be sent out with questions about the process and an option to leave feedback and suggestions.&lt;br /&gt;
* Email survey. An email will be sent out with a user satisfaction survey, asking users to rate different parts of the process.&lt;br /&gt;
* In-app survey before uninstalling/downgrading the WPE (With in-app monetary incentive).&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
* Competitors (like &#039;Revo uninstaller&#039; / Windows native Store)&lt;br /&gt;
* Investors / Venture Capital&lt;br /&gt;
* Performance (DB / Network / Program Design)&lt;br /&gt;
* Balance of team (developers vs testers)&lt;br /&gt;
* Time&lt;br /&gt;
* Unforseeable constraints we have to deal with using Agile Approach&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Hackers and data Breaches&lt;br /&gt;
! Hardware failure&lt;br /&gt;
! Power outages&lt;br /&gt;
! Force majeures&lt;br /&gt;
! Software Issues&lt;br /&gt;
! User errors&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
* Secure software practices&lt;br /&gt;
* Secure network architecture&lt;br /&gt;
* Inhouse team training&lt;br /&gt;
| &lt;br /&gt;
* Backup hardware&lt;br /&gt;
* Cloud / Off-site duplication&lt;br /&gt;
| &lt;br /&gt;
* UPS&lt;br /&gt;
* Power generators&lt;br /&gt;
* Backup servers&lt;br /&gt;
| &lt;br /&gt;
* Correct contracts with customer&lt;br /&gt;
| &lt;br /&gt;
* Increase hiring requirements&lt;br /&gt;
* Hire Testers / Debuggers&lt;br /&gt;
* Educate current developers&lt;br /&gt;
|&lt;br /&gt;
* Create intuitive user experience&lt;br /&gt;
|}&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;br /&gt;
Our group identified a need for an information system that would explain to users applications that either are or could be installed. However after careful analysis we have to come to the conclusion that the application will become obsolete due to an increasing push by Microsoft for Windows 10+ and their native Store. For this application to have a future it should integrate with the native Windows store. Therefore we do not proceed to full development and await further action by Microsoft until project becomes viable. &lt;br /&gt;
&lt;br /&gt;
It is suitable for agile since we can identify Minimum Viable Product requirements&lt;br /&gt;
but due to constantly evolving application market and Windows platform,&lt;br /&gt;
we cannot create a full analysis which lists all requirements from the beginning.&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122857</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122857"/>
		<updated>2017-05-25T12:45:19Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Architectural Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Value Chain Analysis==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IT SWOT==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
==User Stories==&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Flow Diagrams==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE.png |1240px|]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
[[File:Architectural_model_WPE.png]]&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
The main goal is to create an application that would be easily operated by the end user.&lt;br /&gt;
Since the application is mainly meant for the average home user, it cannot require any specific knowledge about computers, or computer related terminology.&lt;br /&gt;
All aformentioned points (additionally see non-functional requirements) need to be kept in mind when designing the UI. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measurable Key Performance Indicators&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Success rate (how many of the user requests come back with a positive responce. i.e. - if a user requests for additional app info, can we provide that information, or will the user get back nothing).&lt;br /&gt;
* Time on task (e.g. how long does it take for the user to upgrade from standard user to premium user. Does it take too much time, and is the process too complicated).&lt;br /&gt;
* Amount of installations.&lt;br /&gt;
* Time user spends in app (active time).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User feedback&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In-app feedback tab (option to select how satisfied the user is with the program in a 1-10 point scale, and a comment box)&lt;br /&gt;
* Post service survey. For instance after a user upgrades from standard user to premium user, an email will be sent out with questions about the process and an option to leave feedback and suggestions.&lt;br /&gt;
* Email survey. An email will be sent out with a user satisfaction survey, asking users to rate different parts of the process.&lt;br /&gt;
* In-app survey before uninstalling/downgrading the WPE (With in-app monetary incentive).&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
* Competitors (like &#039;Revo uninstaller&#039; / Windows native Store)&lt;br /&gt;
* Investors / Venture Capital&lt;br /&gt;
* Performance (DB / Network / Program Design)&lt;br /&gt;
* Balance of team (developers vs testers)&lt;br /&gt;
* Time&lt;br /&gt;
* Unforseeable constraints we have to deal with using Agile Approach&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Hackers and data Breaches&lt;br /&gt;
! Hardware failure&lt;br /&gt;
! Power outages&lt;br /&gt;
! Force majeures&lt;br /&gt;
! Software Issues&lt;br /&gt;
! User errors&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
* Secure software practices&lt;br /&gt;
* Secure network architecture&lt;br /&gt;
* Inhouse team training&lt;br /&gt;
| &lt;br /&gt;
* Backup hardware&lt;br /&gt;
* Cloud / Off-site duplication&lt;br /&gt;
| &lt;br /&gt;
* UPS&lt;br /&gt;
* Power generators&lt;br /&gt;
* Backup servers&lt;br /&gt;
| &lt;br /&gt;
* Correct contracts with customer&lt;br /&gt;
| &lt;br /&gt;
* Increase hiring requirements&lt;br /&gt;
* Hire Testers / Debuggers&lt;br /&gt;
* Educate current developers&lt;br /&gt;
|&lt;br /&gt;
* Create intuitive user experience&lt;br /&gt;
|}&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;br /&gt;
Our group identified a need for an information system that would explain to users applications that either are or could be installed. However after careful analysis we have to come to the conclusion that the application will become obsolete due to an increasing push by Microsoft for Windows 10+ and their native Store. For this application to have a future it should integrate with the native Windows store. Therefore we do not proceed to full development and await further action by Microsoft until project becomes viable. &lt;br /&gt;
&lt;br /&gt;
It is suitable for agile since we can identify Minimum Viable Product requirements&lt;br /&gt;
but due to constantly evolving application market and Windows platform,&lt;br /&gt;
we cannot create a full analysis which lists all requirements from the beginning.&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Architectural_model_WPE.png&amp;diff=122856</id>
		<title>File:Architectural model WPE.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Architectural_model_WPE.png&amp;diff=122856"/>
		<updated>2017-05-25T12:44:32Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122805</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122805"/>
		<updated>2017-05-25T07:41:59Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* ERD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====IT SWOT====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
===User Stories===&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Data Flow Diagrams====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE.png |1240px|]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122804</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122804"/>
		<updated>2017-05-25T07:39:40Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* ERD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====IT SWOT====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
===User Stories===&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Data Flow Diagrams====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;br /&gt;
==Object Oriented Approach==&lt;br /&gt;
===Objects===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Object&lt;br /&gt;
! Class&lt;br /&gt;
! Identifier&lt;br /&gt;
! Actions&lt;br /&gt;
! States&lt;br /&gt;
|-&lt;br /&gt;
| Bob&lt;br /&gt;
| User&lt;br /&gt;
| E-mail &lt;br /&gt;
| Submit requests / Access Premium Features / Inspect Installed Applications / Give Feedback / Submit Descriptions on Applications&lt;br /&gt;
| Verified / Unverified / Registered / Unregistered / Premium / Standard &lt;br /&gt;
|-&lt;br /&gt;
| Notepad&lt;br /&gt;
| Application&lt;br /&gt;
| Name + Version&lt;br /&gt;
| Text Editing&lt;br /&gt;
| Installed / Uninstalled / Running&lt;br /&gt;
|-&lt;br /&gt;
| Peep&lt;br /&gt;
| Development Team&lt;br /&gt;
| Company ID&lt;br /&gt;
| Verify Application Descriptions and Issue updates&lt;br /&gt;
| Working / On Holiday&lt;br /&gt;
|-&lt;br /&gt;
| Microsoft&lt;br /&gt;
| Application Owners&lt;br /&gt;
| Company Name&lt;br /&gt;
| Submit detailed on owned Application&lt;br /&gt;
| Verified/Unverified/Bankrupt&lt;br /&gt;
|-&lt;br /&gt;
| Request detail on Notepad&lt;br /&gt;
| Request&lt;br /&gt;
| Unique Request ID&lt;br /&gt;
| Query internal App database / Query Windows / Contact server&lt;br /&gt;
| Pending / Idle / Denied / Accepted / Finalized&lt;br /&gt;
|-&lt;br /&gt;
| Report on Notepad&lt;br /&gt;
| Report&lt;br /&gt;
| Unique Report ID&lt;br /&gt;
| Return application detailed information&lt;br /&gt;
| Delivery Origin/Successful/Failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Actors===&lt;br /&gt;
* Customer -&amp;gt; Obtain detailed app information / Pay subscription / (Un-)Install application / Find applications&lt;br /&gt;
* Developer -&amp;gt; Develop features / write code / Analyze / Design&lt;br /&gt;
* Application Owner -&amp;gt; Get verified / Provide information on Application(s) / Gain users&lt;br /&gt;
&lt;br /&gt;
===Scenario===&lt;br /&gt;
1. As a customer I want to order premium features.&lt;br /&gt;
&lt;br /&gt;
Standard User wants to buy premium features, clicks on the premium feature section, enters required client details in fields, clicks on make payment button, redirected to payment site where payment finalization is taken care of, verification email sent, order details saved in database.&lt;br /&gt;
&lt;br /&gt;
2. As a Premium User I want to see alternative applications&lt;br /&gt;
&lt;br /&gt;
Premium User wants to see alternative applications, selects the relevant application, clicks on the search for alternatives button, gets a list of alternatives application.&lt;br /&gt;
&lt;br /&gt;
===ERD===&lt;br /&gt;
[[File:ERD_WPE.png]]&lt;br /&gt;
&lt;br /&gt;
==Architectural Model==&lt;br /&gt;
&lt;br /&gt;
==UI - User Experience==&lt;br /&gt;
&lt;br /&gt;
==Constraints==&lt;br /&gt;
&lt;br /&gt;
==Risks and Countermeasures==&lt;br /&gt;
&lt;br /&gt;
==Recommendations and Conclusion==&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:ERD_WPE.png&amp;diff=122803</id>
		<title>File:ERD WPE.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:ERD_WPE.png&amp;diff=122803"/>
		<updated>2017-05-25T07:39:08Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:ERD.png&amp;diff=122802</id>
		<title>File:ERD.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:ERD.png&amp;diff=122802"/>
		<updated>2017-05-25T07:37:52Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: Eocakovs uploaded a new version of File:ERD.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v6.png&amp;diff=122590</id>
		<title>File:DFD lvl1 process1-v6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v6.png&amp;diff=122590"/>
		<updated>2017-05-19T11:22:09Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122589</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122589"/>
		<updated>2017-05-19T11:21:19Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Lvl1-DFD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====IT SWOT====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
===User Stories===&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Data Flow Diagrams====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122588</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122588"/>
		<updated>2017-05-19T11:20:22Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Lvl1-DFD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====IT SWOT====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
===User Stories===&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Data Flow Diagrams====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v5.png]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122587</id>
		<title>File:DFD lvl1 process1-v5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122587"/>
		<updated>2017-05-19T11:19:33Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: Eocakovs uploaded a new version of File:DFD lvl1 process1-v5.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122586</id>
		<title>File:DFD lvl1 process1-v5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122586"/>
		<updated>2017-05-19T11:19:03Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: Eocakovs uploaded a new version of File:DFD lvl1 process1-v5.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122585</id>
		<title>File:DFD lvl1 process1-v5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122585"/>
		<updated>2017-05-19T11:18:36Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: Eocakovs uploaded a new version of File:DFD lvl1 process1-v5.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122584</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122584"/>
		<updated>2017-05-19T11:17:31Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Lvl1-DFD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====IT SWOT====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
===User Stories===&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Data Flow Diagrams====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v6.png]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122583</id>
		<title>File:DFD lvl1 process1-v5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122583"/>
		<updated>2017-05-19T11:17:01Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: Eocakovs uploaded a new version of File:DFD lvl1 process1-v5.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122575</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=122575"/>
		<updated>2017-05-18T19:37:23Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====IT SWOT====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Strength&lt;br /&gt;
! Weakness&lt;br /&gt;
! Opportunities&lt;br /&gt;
! Threats&lt;br /&gt;
|-&lt;br /&gt;
| Innovative - no other popular program like this&lt;br /&gt;
| No brand recognition&lt;br /&gt;
| Globally extending &lt;br /&gt;
| Larger company might sprint past with a similar program &lt;br /&gt;
|-&lt;br /&gt;
| Strong team - well organized, good &lt;br /&gt;
| Small company not a lot of financial backup&lt;br /&gt;
| Expand the team for faster development&lt;br /&gt;
| Sustainable financial backing&lt;br /&gt;
|-&lt;br /&gt;
| Competitively priced&lt;br /&gt;
| Development slow due to the size of the company&lt;br /&gt;
| Targeting industries&lt;br /&gt;
| Customer scepticisim - do not want to give access to scan their computer&lt;br /&gt;
|-&lt;br /&gt;
| User-friendly interface&lt;br /&gt;
| Organic growth - no outside funding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Improvements====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Application Information&lt;br /&gt;
** Due to lack of program information / Methods of updating&lt;br /&gt;
** Trustworthiness / Unknown Sources&lt;br /&gt;
** Customer Perception of the Products [Solution should provide: Transparency for customers / Awareness of Application]&lt;br /&gt;
* Market access / interactions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Short Information System Description====&lt;br /&gt;
&lt;br /&gt;
Information System will provide Windows OS users with detailed information on their installed packages and applications. Provided information will include trustworthiness / rating / availability / checksum / developer details of the application. System will incentivize users and developers to submit descriptions of applications, which would go through a review process before publication. Companies can become verified by us through a paid application verification process thereby granting &amp;quot;trust-ability&amp;quot; to these applications and their developers. Users can subscribe to a live-scanning service which will notify them when any installed packages are compromised or need to be updated.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
====Functional====&lt;br /&gt;
&#039;&#039;&#039;&#039;Users&#039;&#039;&#039;&#039;&lt;br /&gt;
* Users should be able to subscribe to paid services &lt;br /&gt;
* Users should be able to scan their computer and check for installed programs&lt;br /&gt;
* Users should be able to gain information on these installed programs through us (WPE)&lt;br /&gt;
* Users should be able to delete the application&lt;br /&gt;
* Users should be able to request suggestions on alternative&lt;br /&gt;
* Users should be able to search for similar applications&lt;br /&gt;
* Users should be able to search for any application&lt;br /&gt;
* Users should be able to submit their rating/opinion to be reviewed by us&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;Companies&#039;&#039;&#039;&#039;&lt;br /&gt;
* Companies should be able to apply for verification&lt;br /&gt;
* Companies should be able to submit their own description after verification&lt;br /&gt;
&lt;br /&gt;
====Non-Functional====&lt;br /&gt;
* Application shall be operable in offline environment&lt;br /&gt;
* All the application details shall be as transparent to user as possible&lt;br /&gt;
* Every aspect of the software shall be testable&lt;br /&gt;
* User experience of the software shall be as responsive as possible&lt;br /&gt;
* User privacy shall be completely protected&lt;br /&gt;
* Documentation of software shall be easily understood by new developers&lt;br /&gt;
* Backend infrastructure should be scalable&lt;br /&gt;
* Software shall be safe to operate by non technical people&lt;br /&gt;
* Application shall be intuitively operable by 70 year old with minimal technical knowledge&lt;br /&gt;
&lt;br /&gt;
===User Stories===&lt;br /&gt;
* User needs to find specific information on an installed application, enters name into search bar and presses search-button.&lt;br /&gt;
* User finds application, selects it and presses view detailed information button.&lt;br /&gt;
* User sees no specific details about application and presses &amp;quot;request additional information&amp;quot;-button.&lt;br /&gt;
* User looks through provided information, wants to remove the application and presses the &amp;quot;uninstall&amp;quot;-button, confirmation dialogue appears and user confirms his decision.&lt;br /&gt;
* User wants to find possible similar applications, presses &amp;quot;similar apps&amp;quot;-button.&lt;br /&gt;
* Premium user sees notification presses it and opens up a tab with an active analysis of host system.&lt;br /&gt;
* Non-premium user wants to get premium-features, switches to premium-features section which displays features and payment information.&lt;br /&gt;
* User selects preferred amount and payment method from premium-features section which opens up an external browser with preferred payment method&#039;s website.&lt;br /&gt;
* User wants to change how application updates, opens the update options from the settings menu and selects the &amp;quot;ask-for-confirmation-before-update&amp;quot; method.&lt;br /&gt;
* User wants to install a program and check whether the developer is verified or not so searches for the verification signature in the application details.&lt;br /&gt;
* User wants to leave feedback on specific application, clicks &amp;quot;leave feedback&amp;quot; button in the application information details tab that opens up a text-box, the user enters feedback and presses submit button.&lt;br /&gt;
&lt;br /&gt;
====Use-Case High Level Overview====&lt;br /&gt;
[[File:High-lvl-overview-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Data Flow Diagrams====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Context diagram=====&lt;br /&gt;
[[File:Context diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl0-DFD=====&lt;br /&gt;
[[File:Lvl0-DFD.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Lvl1-DFD=====&lt;br /&gt;
[[File:DFD_lvl1_process1-v5.png]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122574</id>
		<title>File:DFD lvl1 process1-v5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:DFD_lvl1_process1-v5.png&amp;diff=122574"/>
		<updated>2017-05-18T19:36:07Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121436</id>
		<title>Operating systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121436"/>
		<updated>2017-05-08T09:41:19Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Students share = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Lecturer=&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/User:Edmund#in_English Edmund Laugasson]&lt;br /&gt;
&lt;br /&gt;
=Intro=&lt;br /&gt;
All subject related infotmation will be put up on Wiki page, due to the possibility to have access to the materials even after the subject has concluded. Materials, such as tests, lectures and links to additional materials, will remain available throughout the subject teaching period.&lt;br /&gt;
&lt;br /&gt;
=Aim of this course=&lt;br /&gt;
&lt;br /&gt;
The aim of this course is to introduce the basics of operating systems and IT system life cycle from the viewpoint of the IT system administrator of operating systems. This subject provides hands-on skills needed to complete other field specific subjects in the curriculum.&lt;br /&gt;
&lt;br /&gt;
Lectures give a theoretical background and the labs give hands-on skills on the same topic using Ubuntu Linux Server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This subject is oriented on hands-on practical assignments to compliment the theoretical side of the subject.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Learning outcome 1: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject is able to perform the most common administrative tasks (user management, software management, disk usage, process management) in at least one of the most popular operating system on a server.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 2: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject understands and is able to explain orally the basic concepts of operating systems and its security aspects.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 3: &lt;br /&gt;
&lt;br /&gt;
The student is able to document an operating system&#039;s service from an IT systems administrator&#039;s viewpoint.&lt;br /&gt;
&lt;br /&gt;
=Portfolio=&lt;br /&gt;
Please fulfill [https://goo.gl/forms/BSEkc2NAoFagQ16R2 the following form].&lt;br /&gt;
&lt;br /&gt;
=Deadlines for assignments=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;03.04.2017&#039;&#039;&#039; - Submission of wiki article&#039;s topic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;02.05.2017&#039;&#039;&#039; - lab works defended&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;08.05.2017 23:59&#039;&#039;&#039; - Submission of wiki article&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09.05.2017&#039;&#039;&#039; - Pre practical test for students, who have done all of their labs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16.05.2017&#039;&#039;&#039; - Last option to defend lab work&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;23.05.2017&#039;&#039;&#039; - Practical test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All dates are inclusive.&lt;br /&gt;
&lt;br /&gt;
=Instant messaging=&lt;br /&gt;
Public chat for any subject related questions can be asked at the channel &#039;&#039;#eitc-osadmin:matrix.org&#039;&#039; and client software: [https://riot.im Riot.im].&lt;br /&gt;
&lt;br /&gt;
[https://riot.im/app Launch Riot here in browser].&lt;br /&gt;
&lt;br /&gt;
=Course materials=&lt;br /&gt;
&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/eng/ Course materials can be found here.]&lt;br /&gt;
* [https://echo360.e-ope.ee/ess/portal/section/4ef8a128-857f-4d6c-a532-733f394f70dc recordings are available here]&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [https://www.codecademy.com/courses/learn-the-command-line learn the command line]&lt;br /&gt;
* [http://upload.itcollege.ee/edmund/ some VMs, ISOs]&lt;br /&gt;
* [http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ 10 Free Linux Administration e-books]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLmbPuZ0NsyGS8ef6zaHd2qYylzsHxL63x Introduction to operating systems (videos)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Operating_system Operating systems (wikipedia article)]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/materials/ additional OSadmin materials]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/ additional materials]&lt;br /&gt;
* [http://debian-handbook.info/browse/stable/ Debian Administrator&#039;s Handbook]&lt;br /&gt;
* [https://help.ubuntu.com/lts/serverguide/ Ubuntu Server Guide]&lt;br /&gt;
* [https://linuxjourney.com/ Linux Journey]&lt;br /&gt;
*&#039;&#039;&#039;[http://enos.itcollege.ee/~edmund/materials/links.html Linux and other free software related links]&#039;&#039;&#039;&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/news.html Linux news, magazines]&lt;br /&gt;
&lt;br /&gt;
==Finding help==&lt;br /&gt;
* https://help.ubuntu.com/ - official documentation&lt;br /&gt;
* https://ubuntu-manual.org/&lt;br /&gt;
&lt;br /&gt;
Also some searches:&lt;br /&gt;
&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+tutorial&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+howto&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Also I encourage to use YouTube which is full of videotutorials.&lt;br /&gt;
&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+tutorial&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+howto&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Certainly all the information might not be trustful but you can test at first in virtual machine if you have doubts. Also ask from instant messenger ([[#Instant messaging|also current course has one]]), IRC-channels. If you search https://www.startpage.com/do/search?q=ubuntu+irc+channel then you will find them. You will also find IRC client howtos.&lt;br /&gt;
&lt;br /&gt;
Usually if to search &amp;quot;problem name or error message + operating system name, version&amp;quot; (without quotation marks) then you will find results (e.g.: &#039;&#039;bluetooth ubuntu 16.04&#039;&#039;). Usually one of the findings will solve a problem or at least give hints what to do and possible workarounds.&lt;br /&gt;
&lt;br /&gt;
Also using different search engines might give different results. In addition of [https://www.google.com/ Google], you can try also [https://www.startpage.com/ Startpage], [https://duckduckgo.com/ DuckDuckGo] etc - https://en.wikipedia.org/wiki/List_of_search_engines&lt;br /&gt;
&lt;br /&gt;
=Lab works=&lt;br /&gt;
Here are some introductory lab tasks available. Labs for assessment are coming into I-Tee virtual laboratory system.&lt;br /&gt;
&lt;br /&gt;
Please check also [https://enos.itcollege.ee/~edmund/osadmin/eng/labs/ log about lab works].&lt;br /&gt;
&lt;br /&gt;
==Lab 0==&lt;br /&gt;
&lt;br /&gt;
Installing Ubuntu Server LTS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction to Unix command line&#039;&#039;&#039; (cd, ls, cat, full path, relative path etc)&lt;br /&gt;
&lt;br /&gt;
==Lab 1== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing users&#039;&#039;&#039; (adduser, addgroup, passwd, /etc/passwd, /etc/shadow)&lt;br /&gt;
&lt;br /&gt;
1) Create a user sysadmin&lt;br /&gt;
&lt;br /&gt;
2) Add a new group devops and add a the user sysadmin to a previously created group.&lt;br /&gt;
&lt;br /&gt;
3) Divert the user sysadmin&#039;s password hash via cowsay to a file called hash.txt.&lt;br /&gt;
&lt;br /&gt;
4) Lock the user sysadmin and be ready to show me the indication of the user being locked. &lt;br /&gt;
&lt;br /&gt;
5) Change the user&#039;s current home directory into /home/unknown so that the files will also be moved to the new location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing files&#039;&#039;&#039; (mkdir, cp, mv, rm, touch, nano, less, chmod, chown, rwx, 644 etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Create a folder march in root user directory and for every march day a subfolder with a name day1, day2, day3 … day31. (Example: /root/march/day1 or /root/march/day2 etc)&lt;br /&gt;
&lt;br /&gt;
2) Modify the march folder owner so that it will be student and the new group audio.&lt;br /&gt;
&lt;br /&gt;
3) Modify the march folder&#039;s and its subfolders so that the user can do anything, group can do ls in the folder and cd into it and others can&#039;t do anything with it.&lt;br /&gt;
&lt;br /&gt;
4) Create a hard link called network to a file /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
5) Copy /var/log directory into march folder so that the timestamp and user info will be preserved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Processes and environment variables&#039;&#039;&#039; (kill, using directing input/output/error: |, &amp;lt;, &amp;gt;, &amp;gt;&amp;gt;; env, PATH, HOME etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Divert the list with the student user&#039;s groups via cowsay into a fail studgroup.txt.&lt;br /&gt;
&lt;br /&gt;
2) Create a environment variable called MYHOME that has the value of the system&#039;s HOME environment variable. (Hint: you have tu use variable symbol here!)&lt;br /&gt;
&lt;br /&gt;
3) Send 2 htop&#039;s to the background and be ready to present how you send a kill signal to the first htop by job number and term signal to the second htop by a process number. &lt;br /&gt;
&lt;br /&gt;
4) Create an alias called bye that logs you out of the terminal. Make this alias permanent. &lt;br /&gt;
&lt;br /&gt;
5) Execute a programm called espdiff and diver the standardoutput to a file called okay.txt and the standard error to a file called notokay.txt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing software&#039;&#039;&#039; (installation, updating, deleting, apt and dpkg utils)&lt;br /&gt;
&lt;br /&gt;
==Lab 2==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing disks by creating partitions&#039;&#039;&#039; (fdisk, mkfs, blkid, mount, umount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing swap&#039;&#039;&#039; (mkswap, swapon, swapoff)&lt;br /&gt;
&lt;br /&gt;
=Practical test=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1FGZcqmQQDF1l32uPUJ6n8x2Tc4gK8nuxS-C9esgRqaQ/edit?usp=sharing First practical test 10th of May 2016]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ZCqOOMkx0dwP0QXLIK_yk_08a8whfJmQbYR1mAoSh7M/edit Second pracical test 24th of May 2016]&lt;br /&gt;
&lt;br /&gt;
=Exam=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ofiylCw9YAS8_S9YHEc8cZOvEfCfMfs2wDoc44eDyCU/edit?usp=sharing Practical exam]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1gkEDb1g1em9UGhj9n_LIwnhp17gY85U9aPtMfGk56_8/edit# Topics] of the oral exam in Spring 2016&lt;br /&gt;
&lt;br /&gt;
=Wiki article=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[OSadmin_wiki_article|for further information please look here]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Former materials=&lt;br /&gt;
* [[Operating systems 2016]]&lt;br /&gt;
&lt;br /&gt;
= Students share =&lt;br /&gt;
[https://kobra.io/#/e/-KjbPHJ0sBTp6Q3QLoIx] Bad documentation&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121435</id>
		<title>Operating systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121435"/>
		<updated>2017-05-08T09:38:27Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Students share = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Lecturer=&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/User:Edmund#in_English Edmund Laugasson]&lt;br /&gt;
&lt;br /&gt;
=Intro=&lt;br /&gt;
All subject related infotmation will be put up on Wiki page, due to the possibility to have access to the materials even after the subject has concluded. Materials, such as tests, lectures and links to additional materials, will remain available throughout the subject teaching period.&lt;br /&gt;
&lt;br /&gt;
=Aim of this course=&lt;br /&gt;
&lt;br /&gt;
The aim of this course is to introduce the basics of operating systems and IT system life cycle from the viewpoint of the IT system administrator of operating systems. This subject provides hands-on skills needed to complete other field specific subjects in the curriculum.&lt;br /&gt;
&lt;br /&gt;
Lectures give a theoretical background and the labs give hands-on skills on the same topic using Ubuntu Linux Server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This subject is oriented on hands-on practical assignments to compliment the theoretical side of the subject.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Learning outcome 1: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject is able to perform the most common administrative tasks (user management, software management, disk usage, process management) in at least one of the most popular operating system on a server.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 2: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject understands and is able to explain orally the basic concepts of operating systems and its security aspects.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 3: &lt;br /&gt;
&lt;br /&gt;
The student is able to document an operating system&#039;s service from an IT systems administrator&#039;s viewpoint.&lt;br /&gt;
&lt;br /&gt;
=Portfolio=&lt;br /&gt;
Please fulfill [https://goo.gl/forms/BSEkc2NAoFagQ16R2 the following form].&lt;br /&gt;
&lt;br /&gt;
=Deadlines for assignments=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;03.04.2017&#039;&#039;&#039; - Submission of wiki article&#039;s topic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;02.05.2017&#039;&#039;&#039; - lab works defended&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;08.05.2017 23:59&#039;&#039;&#039; - Submission of wiki article&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09.05.2017&#039;&#039;&#039; - Pre practical test for students, who have done all of their labs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16.05.2017&#039;&#039;&#039; - Last option to defend lab work&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;23.05.2017&#039;&#039;&#039; - Practical test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All dates are inclusive.&lt;br /&gt;
&lt;br /&gt;
=Instant messaging=&lt;br /&gt;
Public chat for any subject related questions can be asked at the channel &#039;&#039;#eitc-osadmin:matrix.org&#039;&#039; and client software: [https://riot.im Riot.im].&lt;br /&gt;
&lt;br /&gt;
[https://riot.im/app Launch Riot here in browser].&lt;br /&gt;
&lt;br /&gt;
=Course materials=&lt;br /&gt;
&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/eng/ Course materials can be found here.]&lt;br /&gt;
* [https://echo360.e-ope.ee/ess/portal/section/4ef8a128-857f-4d6c-a532-733f394f70dc recordings are available here]&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [https://www.codecademy.com/courses/learn-the-command-line learn the command line]&lt;br /&gt;
* [http://upload.itcollege.ee/edmund/ some VMs, ISOs]&lt;br /&gt;
* [http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ 10 Free Linux Administration e-books]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLmbPuZ0NsyGS8ef6zaHd2qYylzsHxL63x Introduction to operating systems (videos)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Operating_system Operating systems (wikipedia article)]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/materials/ additional OSadmin materials]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/ additional materials]&lt;br /&gt;
* [http://debian-handbook.info/browse/stable/ Debian Administrator&#039;s Handbook]&lt;br /&gt;
* [https://help.ubuntu.com/lts/serverguide/ Ubuntu Server Guide]&lt;br /&gt;
* [https://linuxjourney.com/ Linux Journey]&lt;br /&gt;
*&#039;&#039;&#039;[http://enos.itcollege.ee/~edmund/materials/links.html Linux and other free software related links]&#039;&#039;&#039;&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/news.html Linux news, magazines]&lt;br /&gt;
&lt;br /&gt;
==Finding help==&lt;br /&gt;
* https://help.ubuntu.com/ - official documentation&lt;br /&gt;
* https://ubuntu-manual.org/&lt;br /&gt;
&lt;br /&gt;
Also some searches:&lt;br /&gt;
&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+tutorial&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+howto&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Also I encourage to use YouTube which is full of videotutorials.&lt;br /&gt;
&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+tutorial&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+howto&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Certainly all the information might not be trustful but you can test at first in virtual machine if you have doubts. Also ask from instant messenger ([[#Instant messaging|also current course has one]]), IRC-channels. If you search https://www.startpage.com/do/search?q=ubuntu+irc+channel then you will find them. You will also find IRC client howtos.&lt;br /&gt;
&lt;br /&gt;
Usually if to search &amp;quot;problem name or error message + operating system name, version&amp;quot; (without quotation marks) then you will find results (e.g.: &#039;&#039;bluetooth ubuntu 16.04&#039;&#039;). Usually one of the findings will solve a problem or at least give hints what to do and possible workarounds.&lt;br /&gt;
&lt;br /&gt;
Also using different search engines might give different results. In addition of [https://www.google.com/ Google], you can try also [https://www.startpage.com/ Startpage], [https://duckduckgo.com/ DuckDuckGo] etc - https://en.wikipedia.org/wiki/List_of_search_engines&lt;br /&gt;
&lt;br /&gt;
=Lab works=&lt;br /&gt;
Here are some introductory lab tasks available. Labs for assessment are coming into I-Tee virtual laboratory system.&lt;br /&gt;
&lt;br /&gt;
Please check also [https://enos.itcollege.ee/~edmund/osadmin/eng/labs/ log about lab works].&lt;br /&gt;
&lt;br /&gt;
==Lab 0==&lt;br /&gt;
&lt;br /&gt;
Installing Ubuntu Server LTS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction to Unix command line&#039;&#039;&#039; (cd, ls, cat, full path, relative path etc)&lt;br /&gt;
&lt;br /&gt;
==Lab 1== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing users&#039;&#039;&#039; (adduser, addgroup, passwd, /etc/passwd, /etc/shadow)&lt;br /&gt;
&lt;br /&gt;
1) Create a user sysadmin&lt;br /&gt;
&lt;br /&gt;
2) Add a new group devops and add a the user sysadmin to a previously created group.&lt;br /&gt;
&lt;br /&gt;
3) Divert the user sysadmin&#039;s password hash via cowsay to a file called hash.txt.&lt;br /&gt;
&lt;br /&gt;
4) Lock the user sysadmin and be ready to show me the indication of the user being locked. &lt;br /&gt;
&lt;br /&gt;
5) Change the user&#039;s current home directory into /home/unknown so that the files will also be moved to the new location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing files&#039;&#039;&#039; (mkdir, cp, mv, rm, touch, nano, less, chmod, chown, rwx, 644 etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Create a folder march in root user directory and for every march day a subfolder with a name day1, day2, day3 … day31. (Example: /root/march/day1 or /root/march/day2 etc)&lt;br /&gt;
&lt;br /&gt;
2) Modify the march folder owner so that it will be student and the new group audio.&lt;br /&gt;
&lt;br /&gt;
3) Modify the march folder&#039;s and its subfolders so that the user can do anything, group can do ls in the folder and cd into it and others can&#039;t do anything with it.&lt;br /&gt;
&lt;br /&gt;
4) Create a hard link called network to a file /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
5) Copy /var/log directory into march folder so that the timestamp and user info will be preserved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Processes and environment variables&#039;&#039;&#039; (kill, using directing input/output/error: |, &amp;lt;, &amp;gt;, &amp;gt;&amp;gt;; env, PATH, HOME etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Divert the list with the student user&#039;s groups via cowsay into a fail studgroup.txt.&lt;br /&gt;
&lt;br /&gt;
2) Create a environment variable called MYHOME that has the value of the system&#039;s HOME environment variable. (Hint: you have tu use variable symbol here!)&lt;br /&gt;
&lt;br /&gt;
3) Send 2 htop&#039;s to the background and be ready to present how you send a kill signal to the first htop by job number and term signal to the second htop by a process number. &lt;br /&gt;
&lt;br /&gt;
4) Create an alias called bye that logs you out of the terminal. Make this alias permanent. &lt;br /&gt;
&lt;br /&gt;
5) Execute a programm called espdiff and diver the standardoutput to a file called okay.txt and the standard error to a file called notokay.txt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing software&#039;&#039;&#039; (installation, updating, deleting, apt and dpkg utils)&lt;br /&gt;
&lt;br /&gt;
==Lab 2==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing disks by creating partitions&#039;&#039;&#039; (fdisk, mkfs, blkid, mount, umount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing swap&#039;&#039;&#039; (mkswap, swapon, swapoff)&lt;br /&gt;
&lt;br /&gt;
=Practical test=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1FGZcqmQQDF1l32uPUJ6n8x2Tc4gK8nuxS-C9esgRqaQ/edit?usp=sharing First practical test 10th of May 2016]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ZCqOOMkx0dwP0QXLIK_yk_08a8whfJmQbYR1mAoSh7M/edit Second pracical test 24th of May 2016]&lt;br /&gt;
&lt;br /&gt;
=Exam=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ofiylCw9YAS8_S9YHEc8cZOvEfCfMfs2wDoc44eDyCU/edit?usp=sharing Practical exam]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1gkEDb1g1em9UGhj9n_LIwnhp17gY85U9aPtMfGk56_8/edit# Topics] of the oral exam in Spring 2016&lt;br /&gt;
&lt;br /&gt;
=Wiki article=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[OSadmin_wiki_article|for further information please look here]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Former materials=&lt;br /&gt;
* [[Operating systems 2016]]&lt;br /&gt;
&lt;br /&gt;
= Students share ==&lt;br /&gt;
[https://kobra.io/#/e/-KjbPHJ0sBTp6Q3QLoIx] Bad documentation&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121434</id>
		<title>Operating systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121434"/>
		<updated>2017-05-08T09:35:28Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Students share = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Lecturer=&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/User:Edmund#in_English Edmund Laugasson]&lt;br /&gt;
&lt;br /&gt;
=Intro=&lt;br /&gt;
All subject related infotmation will be put up on Wiki page, due to the possibility to have access to the materials even after the subject has concluded. Materials, such as tests, lectures and links to additional materials, will remain available throughout the subject teaching period.&lt;br /&gt;
&lt;br /&gt;
=Aim of this course=&lt;br /&gt;
&lt;br /&gt;
The aim of this course is to introduce the basics of operating systems and IT system life cycle from the viewpoint of the IT system administrator of operating systems. This subject provides hands-on skills needed to complete other field specific subjects in the curriculum.&lt;br /&gt;
&lt;br /&gt;
Lectures give a theoretical background and the labs give hands-on skills on the same topic using Ubuntu Linux Server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This subject is oriented on hands-on practical assignments to compliment the theoretical side of the subject.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Learning outcome 1: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject is able to perform the most common administrative tasks (user management, software management, disk usage, process management) in at least one of the most popular operating system on a server.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 2: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject understands and is able to explain orally the basic concepts of operating systems and its security aspects.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 3: &lt;br /&gt;
&lt;br /&gt;
The student is able to document an operating system&#039;s service from an IT systems administrator&#039;s viewpoint.&lt;br /&gt;
&lt;br /&gt;
=Portfolio=&lt;br /&gt;
Please fulfill [https://goo.gl/forms/BSEkc2NAoFagQ16R2 the following form].&lt;br /&gt;
&lt;br /&gt;
=Deadlines for assignments=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;03.04.2017&#039;&#039;&#039; - Submission of wiki article&#039;s topic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;02.05.2017&#039;&#039;&#039; - lab works defended&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;08.05.2017 23:59&#039;&#039;&#039; - Submission of wiki article&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09.05.2017&#039;&#039;&#039; - Pre practical test for students, who have done all of their labs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16.05.2017&#039;&#039;&#039; - Last option to defend lab work&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;23.05.2017&#039;&#039;&#039; - Practical test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All dates are inclusive.&lt;br /&gt;
&lt;br /&gt;
=Instant messaging=&lt;br /&gt;
Public chat for any subject related questions can be asked at the channel &#039;&#039;#eitc-osadmin:matrix.org&#039;&#039; and client software: [https://riot.im Riot.im].&lt;br /&gt;
&lt;br /&gt;
[https://riot.im/app Launch Riot here in browser].&lt;br /&gt;
&lt;br /&gt;
=Course materials=&lt;br /&gt;
&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/eng/ Course materials can be found here.]&lt;br /&gt;
* [https://echo360.e-ope.ee/ess/portal/section/4ef8a128-857f-4d6c-a532-733f394f70dc recordings are available here]&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [https://www.codecademy.com/courses/learn-the-command-line learn the command line]&lt;br /&gt;
* [http://upload.itcollege.ee/edmund/ some VMs, ISOs]&lt;br /&gt;
* [http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ 10 Free Linux Administration e-books]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLmbPuZ0NsyGS8ef6zaHd2qYylzsHxL63x Introduction to operating systems (videos)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Operating_system Operating systems (wikipedia article)]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/materials/ additional OSadmin materials]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/ additional materials]&lt;br /&gt;
* [http://debian-handbook.info/browse/stable/ Debian Administrator&#039;s Handbook]&lt;br /&gt;
* [https://help.ubuntu.com/lts/serverguide/ Ubuntu Server Guide]&lt;br /&gt;
* [https://linuxjourney.com/ Linux Journey]&lt;br /&gt;
*&#039;&#039;&#039;[http://enos.itcollege.ee/~edmund/materials/links.html Linux and other free software related links]&#039;&#039;&#039;&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/news.html Linux news, magazines]&lt;br /&gt;
&lt;br /&gt;
==Finding help==&lt;br /&gt;
* https://help.ubuntu.com/ - official documentation&lt;br /&gt;
* https://ubuntu-manual.org/&lt;br /&gt;
&lt;br /&gt;
Also some searches:&lt;br /&gt;
&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+tutorial&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+howto&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Also I encourage to use YouTube which is full of videotutorials.&lt;br /&gt;
&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+tutorial&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+howto&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Certainly all the information might not be trustful but you can test at first in virtual machine if you have doubts. Also ask from instant messenger ([[#Instant messaging|also current course has one]]), IRC-channels. If you search https://www.startpage.com/do/search?q=ubuntu+irc+channel then you will find them. You will also find IRC client howtos.&lt;br /&gt;
&lt;br /&gt;
Usually if to search &amp;quot;problem name or error message + operating system name, version&amp;quot; (without quotation marks) then you will find results (e.g.: &#039;&#039;bluetooth ubuntu 16.04&#039;&#039;). Usually one of the findings will solve a problem or at least give hints what to do and possible workarounds.&lt;br /&gt;
&lt;br /&gt;
Also using different search engines might give different results. In addition of [https://www.google.com/ Google], you can try also [https://www.startpage.com/ Startpage], [https://duckduckgo.com/ DuckDuckGo] etc - https://en.wikipedia.org/wiki/List_of_search_engines&lt;br /&gt;
&lt;br /&gt;
=Lab works=&lt;br /&gt;
Here are some introductory lab tasks available. Labs for assessment are coming into I-Tee virtual laboratory system.&lt;br /&gt;
&lt;br /&gt;
Please check also [https://enos.itcollege.ee/~edmund/osadmin/eng/labs/ log about lab works].&lt;br /&gt;
&lt;br /&gt;
==Lab 0==&lt;br /&gt;
&lt;br /&gt;
Installing Ubuntu Server LTS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction to Unix command line&#039;&#039;&#039; (cd, ls, cat, full path, relative path etc)&lt;br /&gt;
&lt;br /&gt;
==Lab 1== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing users&#039;&#039;&#039; (adduser, addgroup, passwd, /etc/passwd, /etc/shadow)&lt;br /&gt;
&lt;br /&gt;
1) Create a user sysadmin&lt;br /&gt;
&lt;br /&gt;
2) Add a new group devops and add a the user sysadmin to a previously created group.&lt;br /&gt;
&lt;br /&gt;
3) Divert the user sysadmin&#039;s password hash via cowsay to a file called hash.txt.&lt;br /&gt;
&lt;br /&gt;
4) Lock the user sysadmin and be ready to show me the indication of the user being locked. &lt;br /&gt;
&lt;br /&gt;
5) Change the user&#039;s current home directory into /home/unknown so that the files will also be moved to the new location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing files&#039;&#039;&#039; (mkdir, cp, mv, rm, touch, nano, less, chmod, chown, rwx, 644 etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Create a folder march in root user directory and for every march day a subfolder with a name day1, day2, day3 … day31. (Example: /root/march/day1 or /root/march/day2 etc)&lt;br /&gt;
&lt;br /&gt;
2) Modify the march folder owner so that it will be student and the new group audio.&lt;br /&gt;
&lt;br /&gt;
3) Modify the march folder&#039;s and its subfolders so that the user can do anything, group can do ls in the folder and cd into it and others can&#039;t do anything with it.&lt;br /&gt;
&lt;br /&gt;
4) Create a hard link called network to a file /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
5) Copy /var/log directory into march folder so that the timestamp and user info will be preserved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Processes and environment variables&#039;&#039;&#039; (kill, using directing input/output/error: |, &amp;lt;, &amp;gt;, &amp;gt;&amp;gt;; env, PATH, HOME etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Divert the list with the student user&#039;s groups via cowsay into a fail studgroup.txt.&lt;br /&gt;
&lt;br /&gt;
2) Create a environment variable called MYHOME that has the value of the system&#039;s HOME environment variable. (Hint: you have tu use variable symbol here!)&lt;br /&gt;
&lt;br /&gt;
3) Send 2 htop&#039;s to the background and be ready to present how you send a kill signal to the first htop by job number and term signal to the second htop by a process number. &lt;br /&gt;
&lt;br /&gt;
4) Create an alias called bye that logs you out of the terminal. Make this alias permanent. &lt;br /&gt;
&lt;br /&gt;
5) Execute a programm called espdiff and diver the standardoutput to a file called okay.txt and the standard error to a file called notokay.txt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing software&#039;&#039;&#039; (installation, updating, deleting, apt and dpkg utils)&lt;br /&gt;
&lt;br /&gt;
==Lab 2==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing disks by creating partitions&#039;&#039;&#039; (fdisk, mkfs, blkid, mount, umount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing swap&#039;&#039;&#039; (mkswap, swapon, swapoff)&lt;br /&gt;
&lt;br /&gt;
=Practical test=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1FGZcqmQQDF1l32uPUJ6n8x2Tc4gK8nuxS-C9esgRqaQ/edit?usp=sharing First practical test 10th of May 2016]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ZCqOOMkx0dwP0QXLIK_yk_08a8whfJmQbYR1mAoSh7M/edit Second pracical test 24th of May 2016]&lt;br /&gt;
&lt;br /&gt;
=Exam=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ofiylCw9YAS8_S9YHEc8cZOvEfCfMfs2wDoc44eDyCU/edit?usp=sharing Practical exam]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1gkEDb1g1em9UGhj9n_LIwnhp17gY85U9aPtMfGk56_8/edit# Topics] of the oral exam in Spring 2016&lt;br /&gt;
&lt;br /&gt;
=Wiki article=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[OSadmin_wiki_article|for further information please look here]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Former materials=&lt;br /&gt;
* [[Operating systems 2016]]&lt;br /&gt;
&lt;br /&gt;
= Students share ==&lt;br /&gt;
[https://drive.google.com/open?id=0B8doZmdthcFeNkZhMFFXR0lTTjQ] Bad docs&lt;br /&gt;
[https://kobra.io/#/e/-KjbPHJ0sBTp6Q3QLoIx] Bad docs 2&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121433</id>
		<title>Operating systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Operating_systems&amp;diff=121433"/>
		<updated>2017-05-08T09:22:28Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Lecturer=&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/User:Edmund#in_English Edmund Laugasson]&lt;br /&gt;
&lt;br /&gt;
=Intro=&lt;br /&gt;
All subject related infotmation will be put up on Wiki page, due to the possibility to have access to the materials even after the subject has concluded. Materials, such as tests, lectures and links to additional materials, will remain available throughout the subject teaching period.&lt;br /&gt;
&lt;br /&gt;
=Aim of this course=&lt;br /&gt;
&lt;br /&gt;
The aim of this course is to introduce the basics of operating systems and IT system life cycle from the viewpoint of the IT system administrator of operating systems. This subject provides hands-on skills needed to complete other field specific subjects in the curriculum.&lt;br /&gt;
&lt;br /&gt;
Lectures give a theoretical background and the labs give hands-on skills on the same topic using Ubuntu Linux Server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This subject is oriented on hands-on practical assignments to compliment the theoretical side of the subject.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Learning outcome 1: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject is able to perform the most common administrative tasks (user management, software management, disk usage, process management) in at least one of the most popular operating system on a server.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 2: &lt;br /&gt;
&lt;br /&gt;
A student who has completed the subject understands and is able to explain orally the basic concepts of operating systems and its security aspects.&lt;br /&gt;
&lt;br /&gt;
Learning outcome 3: &lt;br /&gt;
&lt;br /&gt;
The student is able to document an operating system&#039;s service from an IT systems administrator&#039;s viewpoint.&lt;br /&gt;
&lt;br /&gt;
=Portfolio=&lt;br /&gt;
Please fulfill [https://goo.gl/forms/BSEkc2NAoFagQ16R2 the following form].&lt;br /&gt;
&lt;br /&gt;
=Deadlines for assignments=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;03.04.2017&#039;&#039;&#039; - Submission of wiki article&#039;s topic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;02.05.2017&#039;&#039;&#039; - lab works defended&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;08.05.2017 23:59&#039;&#039;&#039; - Submission of wiki article&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09.05.2017&#039;&#039;&#039; - Pre practical test for students, who have done all of their labs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16.05.2017&#039;&#039;&#039; - Last option to defend lab work&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;23.05.2017&#039;&#039;&#039; - Practical test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All dates are inclusive.&lt;br /&gt;
&lt;br /&gt;
=Instant messaging=&lt;br /&gt;
Public chat for any subject related questions can be asked at the channel &#039;&#039;#eitc-osadmin:matrix.org&#039;&#039; and client software: [https://riot.im Riot.im].&lt;br /&gt;
&lt;br /&gt;
[https://riot.im/app Launch Riot here in browser].&lt;br /&gt;
&lt;br /&gt;
=Course materials=&lt;br /&gt;
&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/eng/ Course materials can be found here.]&lt;br /&gt;
* [https://echo360.e-ope.ee/ess/portal/section/4ef8a128-857f-4d6c-a532-733f394f70dc recordings are available here]&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [https://www.codecademy.com/courses/learn-the-command-line learn the command line]&lt;br /&gt;
* [http://upload.itcollege.ee/edmund/ some VMs, ISOs]&lt;br /&gt;
* [http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ 10 Free Linux Administration e-books]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLmbPuZ0NsyGS8ef6zaHd2qYylzsHxL63x Introduction to operating systems (videos)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Operating_system Operating systems (wikipedia article)]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/osadmin/materials/ additional OSadmin materials]&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/ additional materials]&lt;br /&gt;
* [http://debian-handbook.info/browse/stable/ Debian Administrator&#039;s Handbook]&lt;br /&gt;
* [https://help.ubuntu.com/lts/serverguide/ Ubuntu Server Guide]&lt;br /&gt;
* [https://linuxjourney.com/ Linux Journey]&lt;br /&gt;
*&#039;&#039;&#039;[http://enos.itcollege.ee/~edmund/materials/links.html Linux and other free software related links]&#039;&#039;&#039;&lt;br /&gt;
* [http://enos.itcollege.ee/~edmund/materials/news.html Linux news, magazines]&lt;br /&gt;
&lt;br /&gt;
==Finding help==&lt;br /&gt;
* https://help.ubuntu.com/ - official documentation&lt;br /&gt;
* https://ubuntu-manual.org/&lt;br /&gt;
&lt;br /&gt;
Also some searches:&lt;br /&gt;
&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+tutorial&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+howto&lt;br /&gt;
* https://www.startpage.com/do/search?q=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Also I encourage to use YouTube which is full of videotutorials.&lt;br /&gt;
&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+tutorial&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+howto&lt;br /&gt;
* https://www.youtube.com/results?search_query=ubuntu+guide&lt;br /&gt;
&lt;br /&gt;
Replace the word &amp;quot;ubuntu&amp;quot; with &amp;quot;linux&amp;quot; and there can be find yet more materials.&lt;br /&gt;
&lt;br /&gt;
Certainly all the information might not be trustful but you can test at first in virtual machine if you have doubts. Also ask from instant messenger ([[#Instant messaging|also current course has one]]), IRC-channels. If you search https://www.startpage.com/do/search?q=ubuntu+irc+channel then you will find them. You will also find IRC client howtos.&lt;br /&gt;
&lt;br /&gt;
Usually if to search &amp;quot;problem name or error message + operating system name, version&amp;quot; (without quotation marks) then you will find results (e.g.: &#039;&#039;bluetooth ubuntu 16.04&#039;&#039;). Usually one of the findings will solve a problem or at least give hints what to do and possible workarounds.&lt;br /&gt;
&lt;br /&gt;
Also using different search engines might give different results. In addition of [https://www.google.com/ Google], you can try also [https://www.startpage.com/ Startpage], [https://duckduckgo.com/ DuckDuckGo] etc - https://en.wikipedia.org/wiki/List_of_search_engines&lt;br /&gt;
&lt;br /&gt;
=Lab works=&lt;br /&gt;
Here are some introductory lab tasks available. Labs for assessment are coming into I-Tee virtual laboratory system.&lt;br /&gt;
&lt;br /&gt;
Please check also [https://enos.itcollege.ee/~edmund/osadmin/eng/labs/ log about lab works].&lt;br /&gt;
&lt;br /&gt;
==Lab 0==&lt;br /&gt;
&lt;br /&gt;
Installing Ubuntu Server LTS&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction to Unix command line&#039;&#039;&#039; (cd, ls, cat, full path, relative path etc)&lt;br /&gt;
&lt;br /&gt;
==Lab 1== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing users&#039;&#039;&#039; (adduser, addgroup, passwd, /etc/passwd, /etc/shadow)&lt;br /&gt;
&lt;br /&gt;
1) Create a user sysadmin&lt;br /&gt;
&lt;br /&gt;
2) Add a new group devops and add a the user sysadmin to a previously created group.&lt;br /&gt;
&lt;br /&gt;
3) Divert the user sysadmin&#039;s password hash via cowsay to a file called hash.txt.&lt;br /&gt;
&lt;br /&gt;
4) Lock the user sysadmin and be ready to show me the indication of the user being locked. &lt;br /&gt;
&lt;br /&gt;
5) Change the user&#039;s current home directory into /home/unknown so that the files will also be moved to the new location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing files&#039;&#039;&#039; (mkdir, cp, mv, rm, touch, nano, less, chmod, chown, rwx, 644 etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Create a folder march in root user directory and for every march day a subfolder with a name day1, day2, day3 … day31. (Example: /root/march/day1 or /root/march/day2 etc)&lt;br /&gt;
&lt;br /&gt;
2) Modify the march folder owner so that it will be student and the new group audio.&lt;br /&gt;
&lt;br /&gt;
3) Modify the march folder&#039;s and its subfolders so that the user can do anything, group can do ls in the folder and cd into it and others can&#039;t do anything with it.&lt;br /&gt;
&lt;br /&gt;
4) Create a hard link called network to a file /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
5) Copy /var/log directory into march folder so that the timestamp and user info will be preserved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Processes and environment variables&#039;&#039;&#039; (kill, using directing input/output/error: |, &amp;lt;, &amp;gt;, &amp;gt;&amp;gt;; env, PATH, HOME etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Divert the list with the student user&#039;s groups via cowsay into a fail studgroup.txt.&lt;br /&gt;
&lt;br /&gt;
2) Create a environment variable called MYHOME that has the value of the system&#039;s HOME environment variable. (Hint: you have tu use variable symbol here!)&lt;br /&gt;
&lt;br /&gt;
3) Send 2 htop&#039;s to the background and be ready to present how you send a kill signal to the first htop by job number and term signal to the second htop by a process number. &lt;br /&gt;
&lt;br /&gt;
4) Create an alias called bye that logs you out of the terminal. Make this alias permanent. &lt;br /&gt;
&lt;br /&gt;
5) Execute a programm called espdiff and diver the standardoutput to a file called okay.txt and the standard error to a file called notokay.txt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing software&#039;&#039;&#039; (installation, updating, deleting, apt and dpkg utils)&lt;br /&gt;
&lt;br /&gt;
==Lab 2==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing disks by creating partitions&#039;&#039;&#039; (fdisk, mkfs, blkid, mount, umount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Managing swap&#039;&#039;&#039; (mkswap, swapon, swapoff)&lt;br /&gt;
&lt;br /&gt;
=Practical test=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1FGZcqmQQDF1l32uPUJ6n8x2Tc4gK8nuxS-C9esgRqaQ/edit?usp=sharing First practical test 10th of May 2016]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ZCqOOMkx0dwP0QXLIK_yk_08a8whfJmQbYR1mAoSh7M/edit Second pracical test 24th of May 2016]&lt;br /&gt;
&lt;br /&gt;
=Exam=&lt;br /&gt;
&lt;br /&gt;
==2016==&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1ofiylCw9YAS8_S9YHEc8cZOvEfCfMfs2wDoc44eDyCU/edit?usp=sharing Practical exam]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1gkEDb1g1em9UGhj9n_LIwnhp17gY85U9aPtMfGk56_8/edit# Topics] of the oral exam in Spring 2016&lt;br /&gt;
&lt;br /&gt;
=Wiki article=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[OSadmin_wiki_article|for further information please look here]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Former materials=&lt;br /&gt;
* [[Operating systems 2016]]&lt;br /&gt;
&lt;br /&gt;
= Students share ==&lt;br /&gt;
[https://drive.google.com/open?id=0B8doZmdthcFeNkZhMFFXR0lTTjQ] Bad docs&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121420</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121420"/>
		<updated>2017-05-08T07:55:56Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
&lt;br /&gt;
    I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
    Additionally here are two great articles that will explain SSH more in depth:&lt;br /&gt;
    [https://wiki.itcollege.ee/index.php/SSH_for_beginners] SSH for beginners by Etienne Barrier.&lt;br /&gt;
    [https://wiki.itcollege.ee/index.php/SSH_Encryption] SSH Encryption by Frank Korving.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will generate an RSA private key &amp;lt;code&amp;gt;~/.ssh/key_file&amp;lt;/code&amp;gt; and public key &amp;lt;code&amp;gt;~/.ssh/key_file.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121419</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121419"/>
		<updated>2017-05-08T07:55:33Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
&lt;br /&gt;
    I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
    Additionally here are two great articles that will explain SHH more in depth:&lt;br /&gt;
    [https://wiki.itcollege.ee/index.php/SSH_for_beginners] SSH for beginners by Etienne Barrier.&lt;br /&gt;
    [https://wiki.itcollege.ee/index.php/SSH_Encryption] SSH Encryption by Frank Korving.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will generate an RSA private key &amp;lt;code&amp;gt;~/.ssh/key_file&amp;lt;/code&amp;gt; and public key &amp;lt;code&amp;gt;~/.ssh/key_file.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121417</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121417"/>
		<updated>2017-05-08T07:54:48Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
&lt;br /&gt;
    I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
    Additionally here are two great articles that will explain SHH more in depth:&lt;br /&gt;
    1. [https://wiki.itcollege.ee/index.php/SSH_for_beginners] SSH for beginners by Etienne Barrier.&lt;br /&gt;
    2. [https://wiki.itcollege.ee/index.php/SSH_Encryption] SSH Encryption by Frank Korving.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will generate an RSA private key &amp;lt;code&amp;gt;~/.ssh/key_file&amp;lt;/code&amp;gt; and public key &amp;lt;code&amp;gt;~/.ssh/key_file.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121416</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121416"/>
		<updated>2017-05-08T07:53:36Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
Additionally here are two great articles that will explain SHH more in depth:&lt;br /&gt;
1. [https://wiki.itcollege.ee/index.php/SSH_for_beginners] SSH for beginners by Etienne Barrier.&lt;br /&gt;
2. [https://wiki.itcollege.ee/index.php/SSH_Encryption] SSH Encryption by Frank Korving&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will generate an RSA private key &amp;lt;code&amp;gt;~/.ssh/key_file&amp;lt;/code&amp;gt; and public key &amp;lt;code&amp;gt;~/.ssh/key_file.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121415</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121415"/>
		<updated>2017-05-08T07:53:13Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
Additionally here are two great articles that will explain SHH more in depth:&lt;br /&gt;
1. [https://wiki.itcollege.ee/index.php/SSH_for_beginners] SSH for beginners by Etienne Barrier.&lt;br /&gt;
2. [https://wiki.itcollege.ee/index.php/SSH_Encryption] SSH Encryption by Frank Korving&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will generate an RSA private key &amp;lt;code&amp;gt;~/.ssh/key_file&amp;lt;/code&amp;gt; and public key &amp;lt;code&amp;gt;~/.ssh/key_file.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121413</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121413"/>
		<updated>2017-05-08T07:46:20Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Tips and tricks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121412</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121412"/>
		<updated>2017-05-08T07:44:10Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Remote source or destination */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121411</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121411"/>
		<updated>2017-05-08T07:43:40Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Remote source or destination */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be &amp;lt;code&amp;gt;~/.ssh/id_rsa&amp;lt;/code&amp;gt; if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121410</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121410"/>
		<updated>2017-05-08T07:42:36Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Remote source or destination */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/path/to/private_key&amp;lt;/code&amp;gt; will usually be ~/.ssh/id_rsa if you generated a key pair using &amp;lt;code&amp;gt;ssh-keygen -f ~/.ssh/id_rsa -t rsa -b 4096&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/private_key&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121391</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121391"/>
		<updated>2017-05-08T06:32:24Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -a 1000 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Please remeber that file permissions for ~/.ssh directory and its subfiles needs to be strict, to make sure of that run the following commands:&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 700 ~/.ssh/&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;chmod 600 ~/.ssh/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121387</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121387"/>
		<updated>2017-05-08T06:24:17Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist*&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121386</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121386"/>
		<updated>2017-05-08T06:23:24Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This will install latest SSH client and server, you can also specify individual pacages, like shown below.&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121384</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121384"/>
		<updated>2017-05-08T06:19:55Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen -t rsa -b 4096 -f ~/.ssh/key_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Talk:Pass&amp;diff=121381</id>
		<title>Talk:Pass</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Talk:Pass&amp;diff=121381"/>
		<updated>2017-05-08T06:12:28Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: Created page with &amp;quot;Would be so much more beneficial to English study mates if it was.... well in English.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Would be so much more beneficial to English study mates if it was.... well in English.&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121338</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121338"/>
		<updated>2017-05-07T18:51:52Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121337</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121337"/>
		<updated>2017-05-07T18:51:41Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121335</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121335"/>
		<updated>2017-05-07T18:51:14Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;And you have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121330</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121330"/>
		<updated>2017-05-07T18:44:46Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines. Leave the passphrase empty if you would like to use this authentication method for automated scripts.&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121326</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121326"/>
		<updated>2017-05-07T18:38:45Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121325</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121325"/>
		<updated>2017-05-07T18:37:00Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Daemon mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo su - rsyncuser&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;pre&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121324</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121324"/>
		<updated>2017-05-07T18:34:03Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo su - rsyncuser&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client openssh-blacklist&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121315</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121315"/>
		<updated>2017-05-07T15:54:17Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo su - rsyncuser&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to ssh and sshd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openssh-server openssh-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service ssh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;ssh-copy-id -i ~/.ssh/key_file user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121314</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121314"/>
		<updated>2017-05-07T15:50:51Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Via remote shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo su - rsyncuser&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to SSH and SSHd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openSSH-server openSSH-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;dnf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/SSH start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service SSH start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;SSH-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;SSH-copy-id -i ~/.ssh/rsa_key.pub user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121313</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121313"/>
		<updated>2017-05-07T15:50:38Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Local-only */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo su - rsyncuser&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to SSH and SSHd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openSSH-server openSSH-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;yum&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/SSH start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service SSH start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;SSH-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;SSH-copy-id -i ~/.ssh/rsa_key.pub user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121312</id>
		<title>Rsync eng</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Rsync_eng&amp;diff=121312"/>
		<updated>2017-05-07T15:49:46Z</updated>

		<summary type="html">&lt;p&gt;Eocakovs: /* Local-only */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Rsync is a command line tool used to copy files locally and over the network. To quote the official website: &amp;amp;quot;Rsync - a fast, versatile, remote (and local) file-copying tool&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsync.html] Rsync official man page&amp;lt;/ref&amp;gt;. The main draw of Rsync is that it tries to copy only differences between files and not the entire file. Which in turn reduces the data traffic on the network and time spent. This is great, if you ever have tried to make efficient backups over network you will appreciate what authors of Rsync have done. Not only that, Rsync incorporates data compression for even grater time and data transfer efficiency.&lt;br /&gt;
&lt;br /&gt;
But wait, there is more - Rsync has built in ability to copy links, devices, owners, groups and permissions. It can be tunneled via SSH. And supports two way transfer.&lt;br /&gt;
&lt;br /&gt;
In short - you can use Rsync to make backups, mirror file systems or any number of similar operations in a fast and secure way.&lt;br /&gt;
&lt;br /&gt;
How can it transfer only file differences you ask? It has its own algorithm that accomplishes that, section [[Rsync_eng#How it works?|How it works?]] will hopefully provide some answers.&lt;br /&gt;
&lt;br /&gt;
=== Key features &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
* Support for copying links, devices, owners, groups and permissions&lt;br /&gt;
* Exclude and exclude-from options similar to GNU tar&lt;br /&gt;
* A CVS exclude mode for ignoring the same files that CVS would ignore&lt;br /&gt;
* Does not require root privileges&lt;br /&gt;
* Pipelining of file transfers to minimize latency costs&lt;br /&gt;
* Support for anonymous or authenticated Rsync servers (ideal for mirroring)&lt;br /&gt;
&lt;br /&gt;
== Table of content ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
&lt;br /&gt;
The way Rsync works is that when an Rsync client is started it will first establish a connection with a server process. This connection may be through pipes or over a network socket.&lt;br /&gt;
&lt;br /&gt;
* Via remote shell&lt;br /&gt;
&lt;br /&gt;
When Rsync communicates with a remote non-daemon server via a remote shell both the Rsync client and server are communicating via pipes through the remote shell. As far as the Rsync processes are concerned there is no network. In this mode the Rsync options for the server process are passed on the command-line that is used to start the remote shell. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot;&amp;gt;[https://rsync.samba.org/how-rsync-works.html] How Rsync Works A Practical Overview&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
Network socket is used when Rsync is communicating with a daemon. This is the only sort of Rsync communication that could be called network aware. In this mode the Rsync options must be sent over the socket. &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Local-only&lt;br /&gt;
&lt;br /&gt;
When Rsync is preforming a local only job the client will fork a server process to become both sender and receiver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the very start of the connection client and server agree on communication protocol version by sending their protocol versions to each other and the minimum version value is used. After connection has been established the side that will be sending the files start generating file list. While file list is being generated each entry in the list is sent to the receiving end in compressed format. When file list is generated both sides sort the file list in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
After both sides have the file list sorted the receiving side will run the generator process, it will compare the file list with its local directory tree. During this comparison each file will be checked if it can be skipped, it will never skip directories, device nodes and symlinks. Also missing directories will be created. When generator process determents that a file is not to be skipped that files original version on receiving end will be considered as data source for the transfer and will be used to eliminate the need to transfer already existing data. Elimination process will be made by taking several block checksum and index checksum pairs of the original file (block checksum size and amount is dependent on size of the file). Each checksum pair is then sent to the data sender (sending side).&lt;br /&gt;
&lt;br /&gt;
When sending side receives the checksums of a file it will generate a hash-table index by index checksums of the original file. Then the local file is read and a index checksum is generated for the block beginning with the first byte of the local file. This index checksum is then compared to hash-table that was previously generated, if a match is found then a block checksum is generated of the local file from the same byte, and if no match is found, the non-matching byte will be appended to the non-matching data and the block starting at the next byte will be compared. This is what is referred to as the “rolling checksum” &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the matched an non-matching data is sent to the receiving side. The important part here is that for matched data only block and index checksums are sent, with requires very little network utilization, only for non-matching data checksums and data is sent. Non-matching data will be sent to the receiver followed by the offset and length in the original file of the matching block and the block checksum generator will be advanced to the next byte after the matching block. Matching blocks can be identified in this way even if the blocks are reordered or at different offsets &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this way, the sender will give the receiver instructions for how to reconstruct the source file into a new destination file. These instructions detail all the matching data that can be copied from the basis file (if one exists for the transfer), and includes any raw data that was not available locally. At the end of each file&#039;s processing a whole-file checksum is sent and the sender proceeds with the next file. Generating the rolling checksums and searching for matches in the checksum set sent by the receiving side require a good deal of CPU power. Of all the rsync processes it is the sender that is the most CPU intensive.&lt;br /&gt;
&lt;br /&gt;
The receiver will read from the sender data for each file identified by the index checksum. It will open the local file (called the basis) and will create a temporary file.&lt;br /&gt;
&lt;br /&gt;
The receiver will expect to read non-matched data and/or to match records all in sequence for the final file contents. When non-matched data is read it will be written to the temp-file. When a block match record is received the receiver will seek to the block offset in the basis file and copy the block to the temp-file. In this way the temp-file is built from beginning to end.&lt;br /&gt;
&lt;br /&gt;
The file&#039;s checksum is generated as the temp-file is built. At the end of the file, this checksum is compared with the file checksum from the sender. If the file checksums do not match the temp-file is deleted. If the file fails once it will be reprocessed in a second phase, and if it fails twice an error is reported.&lt;br /&gt;
&lt;br /&gt;
After the temp-file has been completed, its ownership and permissions and modification time are set. It is then renamed to replace the basis file.&lt;br /&gt;
&lt;br /&gt;
Copying data from the basis file to the temp-file make the receiver the most disk intensive of all the rsync processes. Small files may still be in disk cache mitigating this but for large files the cache may thrash as the generator has moved on to other files and there is further latency caused by the sender. As data is read possibly at random from one file and written to another, if the working set is larger than the disk cache, then what is called a seek storm can occur, further hurting performance &amp;lt;ref name=&amp;quot;How Rsync Works&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are interested how well Rsync algorithm preforms I suggest you read [http://www-2.cs.cmu.edu/~jcl/research/mrsync/mrsync.ps Multiround Rsync] by John Langford. He compares Rsync algorithm to his own improved version and by doing that has provided quite detailed analysis of Rsync algorithm performance.&lt;br /&gt;
&lt;br /&gt;
== Quick start guide ==&lt;br /&gt;
&lt;br /&gt;
For people who are in a hurry.&lt;br /&gt;
&lt;br /&gt;
;Debian based machine and Rsync in local-only mode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open terminal and paste the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&lt;br /&gt;
rsync -av ~/ /tmp/my_local_backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
Congratulations! you have made a backup of your home directory.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
;Setup will not cover Windows machines&#039;&#039;&#039; If you are interested in setting up Rsync vis SSH on Windows I suggest looking at [https://itefix.net/free itefix] solutions for installing SSH and Rsync.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned in the beginning of [[Rsync_eng#How it works?|How it works?]] section there are several ways Rsync can be used - in a daemon mode, via remote shell or locally.&lt;br /&gt;
&lt;br /&gt;
Each of these cases will require slightly different setup process. Because of that reason I have split up setup in 3 subsections for each use case.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
In this case you will need only Rsync itself and all the transfer parameters will be passed to Rsync itself as command line options.&lt;br /&gt;
&lt;br /&gt;
First check if you have Rsync already installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;which rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the the output returns a path to rsync then you are all done and can skip directly to [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
Otherwise depending on your system run the following commands:&lt;br /&gt;
&lt;br /&gt;
* Debian based machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Fedora machine&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo yum install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
* OpenSUSE&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo zypper install rsync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Daemon mode ===&lt;br /&gt;
&lt;br /&gt;
In this case, the way Rsync will work is that at least one of the machines involved in data transfer needs to be an &amp;amp;quot;rsync server&amp;amp;quot; by running Rsync in a daemon mode (&amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; at the command line) and setting up a short, easy configuration file (&amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt;) &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot;&amp;gt;[http://everythinglinux.org/rsync/] Tutorial on using Rsync&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any number of machines with Rsync installed may then synchronize to and/or from the machine running the Rsync daemon. &amp;lt;ref name=&amp;quot;Rsync tutorial&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way of using Rsync is beneficial if you don&#039;t want or need the client to specify the file transfer options and path, since you can explicitly specify what and how can be transfered to or from remote machine.&lt;br /&gt;
&lt;br /&gt;
First follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on &#039;&#039;&#039;all&#039;&#039;&#039; machines involved in the transfer process.&lt;br /&gt;
&lt;br /&gt;
When Rsync is installed you need to set up Rsync in a daemon mode on at least one of the machines involved in data transfer. For that we will set up a configuration file on that machine.&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; in your favorite text editor and paste the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;motd file = /path/to/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
syslog facility = local5&lt;br /&gt;
reverse lookup = no&lt;br /&gt;
&lt;br /&gt;
[no_security_module]&lt;br /&gt;
  path = /path/to/files ./pub&lt;br /&gt;
  comment = Some files to sync (approx 6.1 GB)&lt;br /&gt;
&lt;br /&gt;
[more_security_module]&lt;br /&gt;
  path = /path/to/files&lt;br /&gt;
  comment = Some files to sync (approx 10.2 GB)&lt;br /&gt;
  uid = nobody&lt;br /&gt;
  gid = nobody&lt;br /&gt;
  read only = no&lt;br /&gt;
  list = yes&lt;br /&gt;
  auth users = username, anotheruser&lt;br /&gt;
  secrets file = /path/to/rsyncd.scrt&lt;br /&gt;
  reverse lookup = yes&lt;br /&gt;
  hosts allow = 10.0.1.12, 192.168.0.0/16, fe80::/64, 172.16.143.*&lt;br /&gt;
  refuse options = c delete&lt;br /&gt;
  max connections = 4&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;To see detailed explanation of the parameters we pasted to &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; see [[Rsync_eng#rsyncd.conf parameters|rsyncd.conf parameters]] section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters shown above can be adjured to your personal preference. I have shown 2 different modules, that are marked by square brackets surrounding them. &#039;no_security_module&#039; module is a very basic one that just mentions a path to be synced and a comment. &#039;more_security_module&#039; one is more complex and is aimed at securing the connection if secure remote shell is not used.&lt;br /&gt;
&lt;br /&gt;
If you will be using the more secure module then open &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; in your favorite text editor and add user names and passwords for users you wrote in &amp;lt;code&amp;gt;auth users&amp;lt;/code&amp;gt; parameter. Format for the file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;username:password&lt;br /&gt;
bob:bobspass&lt;br /&gt;
sally:herpass&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Users that you list in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt; are not your system users, they are arbitrary users that will be used only for Rsync process.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;All the paths listed in &amp;lt;code&amp;gt;/etc/rsyncd.conf&amp;lt;/code&amp;gt; need to be accessible by Rsync.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;It is important that &amp;lt;code&amp;gt;rsyncd.scrt&amp;lt;/code&amp;gt; file must be accessible only to user that runs Rsync daemon, because it contains user name and password information. I would suggest using the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo su - rsyncuser&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;sudo chmod 600 /path/to/rsyncd.scrt&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Rsync daemon usually listens to TCP port 873, so don&#039;t forget to white-list it in you firewall.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration file has been made you can start up Rsync in daemon mode by running &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Later on if you want the daemon process to be started automatically you can either use inet daemon or place &amp;lt;code&amp;gt;rsync --daemon&amp;lt;/code&amp;gt; command in a shell script and add it to startup, both methods have their merit, which one you use is up to you.&lt;br /&gt;
&lt;br /&gt;
=== Via remote shell ===&lt;br /&gt;
&lt;br /&gt;
One of the most convenient ways to use Rsync is via remote shell, it will allow you to bypass setting up Rsync built in authentication system. Also It will provide security layer since Rsync authentication protocol is a 128 bit MD4 based challenge response system &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot;&amp;gt;[https://download.samba.org/pub/rsync/rsyncd.conf.html] Rsync daemon configuration file man page&amp;lt;/ref&amp;gt; which is quite poor. On top of that using SSH will provide data encryption.&lt;br /&gt;
&lt;br /&gt;
That is why I suggest using [https://kimmo.suominen.com/docs/SSH/ SSH] as your remote shell with Rsync.&lt;br /&gt;
&lt;br /&gt;
Before dealing with SSH follow the steps listed in [[Rsync_eng#Setup|Setup]] Local-only subsection on all machines involved in the transfer process. When that is done, follow the steps below.&lt;br /&gt;
&lt;br /&gt;
;First you need to makes sure you have SSH client installed.&lt;br /&gt;
:On Unix like machine you could do the following:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which ssh&amp;lt;/pre&amp;gt;&lt;br /&gt;
;You have SSH server installed and running on the server machine.&lt;br /&gt;
:You can do it with the following command:&lt;br /&gt;
:&amp;lt;pre&amp;gt;which sshd&amp;lt;/pre&amp;gt;&lt;br /&gt;
:If the the output shows path to SSH and SSHd then you can skip this step.&lt;br /&gt;
:Otherwise use following commands.&lt;br /&gt;
:* Debian based machine&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo apt install openSSH-server openSSH-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
:For Fedora and OpenSUSE machines use &amp;lt;code&amp;gt;yum&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
:&lt;br /&gt;
;At this point you should have both Rsync and SSH on all machines involved in the data transfer.&lt;br /&gt;
:I will not go trough full SSH setup, for that please see [http://troy.jdmz.net/rsync/index.html this] link.&lt;br /&gt;
:The basics go like this:&lt;br /&gt;
:* Start up sshd process on server&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo /etc/init.d/SSH start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;sudo service SSH start&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Generate keys on both machines&lt;br /&gt;
:&amp;lt;pre&amp;gt;SSH-keygen&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Copy public key from client to server&lt;br /&gt;
:&amp;lt;pre&amp;gt;SSH-copy-id -i ~/.ssh/rsa_key.pub user@IP-address&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Rsync is used via SSH you can still use Rsync in daemon mode to use preconfigure modules, see subsection Daemon mode of [[Rsync_eng#Setup|Setup]]. In that case only the usage syntax will change as specified in [[Rsync_eng#Usage|Usage]] section.&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;Local: rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
Access via remote shell:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
Access via rsync daemon:&lt;br /&gt;
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usages with just one SRC arg and no DEST arg will list the source files instead of copying &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You use Rsync in the same way you use &amp;lt;code&amp;gt;rcp&amp;lt;/code&amp;gt;. You must specify a source and a destination, one of which may be remote &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All the Rsync command line options used below are explained in [[Rsync_eng#Command options|Command options]] section.&lt;br /&gt;
&lt;br /&gt;
=== Local-only ===&lt;br /&gt;
&lt;br /&gt;
Rsync can be used to copy files to remote detestation or locally. In case of local-only use it behaves like an improved copy command.&lt;br /&gt;
&lt;br /&gt;
Command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer all files matching the pattern *.c from the current directory to the directory src. If any of the files already exist on the remote system then the Rsync remote-update protocol is used to update the file by sending only the differences &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another way is to specify the directory you would like to copy. It can be done in two ways. One is by including trailing slash in the source path, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Second option is to omit the trailing slash, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would will copy all the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; directory, including the directory itself to &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; directory, so in the end we will have the content of &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; in this path - &amp;lt;code&amp;gt;/path/to/destination/source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To copy directories or files that include white spaces surround them with &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; or in newer versions of Rsync use the &#039;&#039;&#039;--protect-args (-s)&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync &#039;/file with spaces&#039; /path/to/destination&lt;br /&gt;
&lt;br /&gt;
rsync -s /file with spaces /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to transfer several files from the source to the same destination you would do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -av /file1 /file2 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remote source or destination ===&lt;br /&gt;
&lt;br /&gt;
When remote source or destination is used a way of contacting remote system must be specified. There are two ways:&lt;br /&gt;
&lt;br /&gt;
* Using a remote-shell program as the transport (such as SSH). When using this method source or destination path contains a single colon (:) separator after a host specification.&lt;br /&gt;
* Contacting an Rsync daemon directly via TCP This happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified&lt;br /&gt;
&lt;br /&gt;
There is however exception to this rule, if double colon (::) separator syntax is used and remote shell is specified via --rsh (-e) option then a single use daemon will be spawned on remote host that will read its configuration file from specified users home directory. This however is not the best way to secure a daemon transfer. Better way would be using ssh to tunnel a local port to a remote machine and configure a normal rsync daemon on that remote host to only allow connections from &amp;amp;quot;localhost&amp;amp;quot; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For instructions on SSH port forwarding see [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local source to remote destination command sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -t *.c foo:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
This the same as local-only sample only it copies files to the directory src on the machine foo.&lt;br /&gt;
&lt;br /&gt;
To expand on previous sample depending on the remote host setup.&lt;br /&gt;
&lt;br /&gt;
* Daemon mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz *.c username@10.0.2.20::module_name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote shell&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -tavz -e &#039;ssh -i /path/to/private_key.pem&#039; *.c user@10.0.2.20:src/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see in daemon mode we specify remote destination ip followed by &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; and the module we want to use, as per installation instructions module contains all the configuration options. And note that &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is a user specified in &amp;lt;code&amp;gt;/path/to/rsyncd.scrt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In remote shell mode we specify remote shell via -e option and SSH &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; and ip of the destination followed by &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; and destination path.&lt;br /&gt;
&lt;br /&gt;
A bit more complex sample using ssh from remote source to local destination.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/file{1,2} :/file3 user@172.16.1.10:/file4 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
This would transfer files - file1, file2, file3 from &amp;lt;code&amp;gt;10.0.2.20&amp;lt;/code&amp;gt; and file4 from &amp;lt;code&amp;gt;172.16.1.10&amp;lt;/code&amp;gt; to /path/to/destination on local machine. It shows the versatility of Rsync, you can specify several individual files on remote host - &amp;lt;code&amp;gt;:/file1 :/file2&amp;lt;/code&amp;gt; or you can specify a pattern &amp;lt;code&amp;gt;/file{1,2}&amp;lt;/code&amp;gt;. Also you can specify several remote hosts if the ssh key you provided will match public key on remote machines.&lt;br /&gt;
&lt;br /&gt;
You can do similarly if transferring in daemon mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name/file{1,2} user@172.16.1.10::module_name/file3 /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
Directory copy works the same as in local-only mode only difference is that you have to specify remote host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -avz user@10.0.2.20::module_name /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
One important thing to note that host and module references don&#039;t require a trailing slash to copy the contents of the default directory &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Special case ===&lt;br /&gt;
&lt;br /&gt;
If a single source argument is specified without a destination, the files are listed in an output format similar to &amp;lt;code&amp;gt;ls -l &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks ===&lt;br /&gt;
&lt;br /&gt;
;Use filters to exclude or include files.&lt;br /&gt;
: This is useful if for example you would like to transfer specific pattern and exclude some fies from that pattern or exclude all files but the ones you specify in include rule.&lt;br /&gt;
:There are several ways of doing it:&lt;br /&gt;
:* filter option&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --filter &#039;- *.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would exclude files with &amp;lt;code&amp;gt;*.tmp&amp;lt;/code&amp;gt; pattern.&lt;br /&gt;
:&lt;br /&gt;
:* exclude / include options&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude &#039;*.tmp&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would do the same as above sample.&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --include &#039;*.txt&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This would include &amp;lt;code&amp;gt;*.txt&amp;lt;/code&amp;gt; file pattern, it would be useful only in combination with exclude pattern, because Rsync will transfer all the files anyway if exclude option is not specified.&lt;br /&gt;
:&lt;br /&gt;
:*Using exclude / include file&lt;br /&gt;
:It is a bit more versatile method, because you don&#039;t have to clutter your command line options with possibly dozens of filters.&lt;br /&gt;
:To pass file with filters you would do something like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;rsync -av --exclude-from &#039;/exclude_file&#039; --include-from &#039;/include_file&#039; /path/to/source/ /path/to/destination&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And the files themselves would have the new line separated exclude / include pattern:&lt;br /&gt;
:&amp;lt;pre&amp;gt;*.temp   /some/dir   *.txt   */some/other/dir&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Also not that if you use &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; as exclude rule everything will be excluded, so if you want to exclude everything except specific pattern first specify an include rule something like &amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt; that would tell to include the directory itself&lt;br /&gt;
&lt;br /&gt;
;Store a password file on local machine to avoid typing password when transferring daemon mode.&lt;br /&gt;
:Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.&lt;br /&gt;
:WARNING: On some systems environment variables are visible to all users. On those systems using --password-file is recommended &amp;lt;/code&amp;gt; &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Set up scripts or make files together with cron jobs to automate the process.&lt;br /&gt;
:First you would need to create a script on make file, you can do that for example by opening a file in text editor:&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
:or&lt;br /&gt;
:&amp;lt;pre&amp;gt;nano ~/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Depending witch option you chose you would write something like this in to script file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:And something like this in to Makefile:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;backup:&lt;br /&gt;
    rsync -avz -e &#039;ssh -i /path/to/pemfile.pem&#039; user@10.0.2.20:/path/to/source /path/to/destination&amp;lt;/source&amp;gt;&lt;br /&gt;
:Then you would edit your Crontab like so:&lt;br /&gt;
:&amp;lt;pre&amp;gt;crontab -e&amp;lt;/pre&amp;gt;&lt;br /&gt;
:And there you would write something like this for Bash script:&lt;br /&gt;
:&amp;lt;pre&amp;gt;5 0 * * *     $HOME/backup_files.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find out about Bash, Makefile and Crontab below.&lt;br /&gt;
&lt;br /&gt;
[http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Bash]&lt;br /&gt;
[http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefile]&lt;br /&gt;
[https://linux.die.net/man/1/crontab Crontab]&lt;br /&gt;
&lt;br /&gt;
== Command options ==&lt;br /&gt;
&lt;br /&gt;
Rsync options used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This section is filtered copy from man &amp;lt;ref name=&amp;quot;rsync man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options.&lt;br /&gt;
&lt;br /&gt;
;-a, --archive&lt;br /&gt;
:This is equivalent to &#039;&#039;&#039;-rlptgoD&#039;&#039;&#039;. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when &#039;&#039;&#039;--files-from&#039;&#039;&#039; is specified, in which case -r is not implied. Note that &#039;&#039;&#039;-a does not preserve hardlinks&#039;&#039;&#039;, because finding multiply-linked files is expensive. You must separately specify -H.&lt;br /&gt;
&lt;br /&gt;
;-v, --verbose&lt;br /&gt;
:This option increases the amount of information you are given during the transfer. By default, rsync works silently. A single &#039;&#039;&#039;-v&#039;&#039;&#039; will give you information about what files are being transferred and a brief summary at the end. Two &#039;&#039;&#039;-v&#039;&#039;&#039; options will give you information on what files are being skipped and slightly more information at the end. More than two &#039;&#039;&#039;-v&#039;&#039;&#039; options should only be used if you are debugging rsync. In a modern rsync, the &#039;&#039;&#039;-v&#039;&#039;&#039; option is equivalent to the setting of groups of &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; options. You can choose to use these newer options in addition to, or in place of using &#039;&#039;&#039;--verbose&#039;&#039;&#039;, as any fine-grained settings override the implied settings of &#039;&#039;&#039;-v&#039;&#039;&#039;. Both &#039;&#039;&#039;--info&#039;&#039;&#039; and &#039;&#039;&#039;--debug&#039;&#039;&#039; have a way to ask for help that tells you exactly what flags are set for each increase in verbosity.&lt;br /&gt;
&lt;br /&gt;
:However, do keep in mind that a daemon&#039;s &amp;amp;quot;max verbosity&amp;amp;quot; setting will limit how high of a level the various individual flags can be set on the daemon side. For instance, if the max is 2, then any info and/or debug flag that is set to a higher value than what would be set by &#039;&#039;&#039;-vv&#039;&#039;&#039; will be downgraded to the &#039;&#039;&#039;-vv&#039;&#039;&#039; level in the daemon&#039;s logging.&lt;br /&gt;
&lt;br /&gt;
;-z, --compress&lt;br /&gt;
:With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection. Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection. This matching-data compression comes at a cost of CPU, though, and can be disabled by repeating the -z option, but only if both sides are at least version 3.1.1.&lt;br /&gt;
&lt;br /&gt;
:Note that if your version of rsync was compiled with an external zlib (instead of the zlib that comes packaged with rsync) then it will not support the old-style compression, only the new-style (repeated-option) compression. In the future this new-style compression will likely become the default.&lt;br /&gt;
&lt;br /&gt;
:The client rsync requests new-style compression on the server via the &#039;&#039;&#039;--new-compress&#039;&#039;&#039; option, so if you see that option rejected it means that the server is not new enough to support &#039;&#039;&#039;-zz&#039;&#039;&#039;. Rsync also accepts the &#039;&#039;&#039;--old-compress&#039;&#039;&#039; option for a future time when new-style compression becomes the default.&lt;br /&gt;
&lt;br /&gt;
:See the &#039;&#039;&#039;--skip-compress&#039;&#039;&#039; option for the default list of file suffixes that will not be compressed.&lt;br /&gt;
&lt;br /&gt;
;-t, --times&lt;br /&gt;
:This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing &#039;&#039;&#039;-t&#039;&#039;&#039; or &#039;&#039;&#039;-a&#039;&#039;&#039; will cause the next transfer to behave as if it used &#039;&#039;&#039;-I&#039;&#039;&#039;, causing all files to be updated (though rsync&#039;s delta-transfer algorithm will make the update fairly efficient if the files haven&#039;t actually changed, you&#039;re much better off using &#039;&#039;&#039;-t&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
;-e, --rsh=COMMAND&lt;br /&gt;
:This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network. If this option is used with &#039;&#039;&#039;[user@]host::module/path&#039;&#039;&#039;, then the remote shell COMMAND will be used to run an rsync daemon on the remote host, and all data will be transmitted through that remote shell connection, rather than through a direct socket connection to a running rsync daemon on the remote host. See the section &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION&amp;amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
:Command-line arguments are permitted in COMMAND provided that COMMAND is presented to rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command and args from each other, and you can use single- and/or double-quotes to preserve spaces in an argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a single-quote; likewise for double-quotes (though you need to pay attention to which quotes your shell is parsing and which quotes rsync is parsing). Some examples:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;-e &#039;ssh -p 2234&#039; -e &#039;ssh -o &amp;amp;quot;ProxyCommand nohup ssh firewall nc -w1 %h %p&amp;amp;quot;&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:(Note that ssh users can alternately customize site-specific connect options in their .ssh/config file.)&lt;br /&gt;
&lt;br /&gt;
:You can also choose the remote shell program using the RSYNC_RSH environment variable, which accepts the same range of values as -e.&lt;br /&gt;
&lt;br /&gt;
:See also the &#039;&#039;&#039;--blocking-io&#039;&#039;&#039; option which is affected by this option.&lt;br /&gt;
&lt;br /&gt;
;-f, --filter=RULE&lt;br /&gt;
:This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. You may use as many &#039;&#039;&#039;--filter&#039;&#039;&#039; options on the command line as you like to build up the list of files to exclude. If the filter contains whitespace, be sure to quote it so that the shell gives the rule to rsync as a single argument. The text below also mentions that you can use an underscore to replace the space that separates a rule from its arg.&lt;br /&gt;
&lt;br /&gt;
:See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--exclude-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--exclude&#039;&#039;&#039; option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
;--include=PATTERN&lt;br /&gt;
:This option is a simplified form of the &#039;&#039;&#039;--filter&#039;&#039;&#039; option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option.&lt;br /&gt;
&lt;br /&gt;
;--include-from=FILE&lt;br /&gt;
:This option is related to the &#039;&#039;&#039;--include&#039;&#039;&#039; option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with &#039;;&#039; or &#039;#&#039; are ignored. If FILE is -, the list will be read from standard input.&lt;br /&gt;
&lt;br /&gt;
All of the options can be found on Rsync [https://download.samba.org/pub/rsync/rsync.html man page]&lt;br /&gt;
&lt;br /&gt;
== rsyncd.conf parameters ==&lt;br /&gt;
&lt;br /&gt;
Rsyncd.conf parameters used in this article can be found below.&lt;br /&gt;
&lt;br /&gt;
This scetion is filtered copy of Rsync daemon man &amp;lt;ref name=&amp;quot;Rsync daemon man&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration file consists of modules and parameters. A module begins with the name of the module in square brackets and continues until the next module begins. Modules contain parameters of the form &amp;amp;quot;name = value&amp;amp;quot;. The first parameters in the file (before a [module] header) are the global parameters. [https://download.samba.org/pub/rsync/rsyncd.conf.html ref]&lt;br /&gt;
&lt;br /&gt;
A useful option is to use references to environment variables in the values of parameters. Like so &amp;lt;code&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/code&amp;gt; where RSYNC_USER_NAME is an environment variable.&lt;br /&gt;
&lt;br /&gt;
;motd file&lt;br /&gt;
:This parameter allows you to specify a &amp;amp;quot;message of the day&amp;amp;quot; to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file. This can be overridden by the &#039;&#039;&#039;--dparam=motdfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;log file&lt;br /&gt;
:When the &amp;amp;quot;log file&amp;amp;quot; parameter is set to a non-empty string, the rsync daemon will log messages to the indicated file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn&#039;t work for chrooted programs. The file is opened before chroot() is called, allowing it to be placed outside the transfer. If this value is set on a per-module basis instead of globally, the global log will still contain any authorization failures or config-file error messages. If the daemon fails to open the specified file, it will fall back to using syslog and output an error about the failure. (Note that the failure to open the specified log file used to be a fatal error.)&lt;br /&gt;
&lt;br /&gt;
:This setting can be overridden by using the &#039;&#039;&#039;--log-file=FILE&#039;&#039;&#039; or &#039;&#039;&#039;--dparam=logfile=FILE&#039;&#039;&#039; command-line options. The former overrides all the log-file parameters of the daemon and all module settings. The latter sets the daemon&#039;s log file and the default for all the modules, which still allows modules to override the default setting.&lt;br /&gt;
&lt;br /&gt;
;pid file&lt;br /&gt;
:This parameter tells the rsync daemon to write its process ID to that file. If the file already exists, the rsync daemon will abort rather than overwrite the file. This can be overridden by the &#039;&#039;&#039;--dparam=pidfile=FILE&#039;&#039;&#039; command-line option when starting the daemon.&lt;br /&gt;
&lt;br /&gt;
;lock file&lt;br /&gt;
:This parameter specifies the file to use to support the &amp;amp;quot;max connections&amp;amp;quot; parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is &amp;lt;code&amp;gt;/var/run/rsyncd.lock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;syslog facility&lt;br /&gt;
:This parameter allows you to specify the syslog facility name to use when logging messages from the rsync daemon. You may use any standard syslog facility name which is defined on your system. Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 and local7. The default is daemon. This setting has no effect if the &amp;amp;quot;log file&amp;amp;quot; setting is a non-empty string (either set in the per-modules settings, or inherited from the global settings).&lt;br /&gt;
&lt;br /&gt;
;reverse lookup&lt;br /&gt;
:Controls whether the daemon performs a reverse lookup on the client&#039;s IP address to determine its hostname, which is used for &amp;amp;quot;hosts allow&amp;amp;quot;/&amp;amp;quot;hosts deny&amp;amp;quot; checks and the &amp;amp;quot;%h&amp;amp;quot; log escape. This is enabled by default, but you may wish to disable it to save time if you know the lookup will not return a useful result, in which case the daemon will use the name &amp;amp;quot;UNDETERMINED&amp;amp;quot; instead. If this parameter is enabled globally (even by default), rsync performs the lookup as soon as a client connects, so disabling it for a module will not avoid the lookup. Thus, you probably want to disable it globally and then enable it for modules that need the information.&lt;br /&gt;
&lt;br /&gt;
;path&lt;br /&gt;
:This parameter specifies the directory in the daemon&#039;s filesystem to make available in this module. You must specify this parameter for each module in rsyncd.conf. You may base the path&#039;s value off of an environment variable by surrounding the variable name with percent signs. You can even reference a variable that is set by rsync when the user connects. For example, this would use the authorizing user&#039;s name in the path:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  path = /home/%RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:It is fine if the path includes internal spaces -- they will be retained verbatim (which means that you shouldn&#039;t try to escape them). If your final directory has a trailing space (and this is somehow not something you wish to fix), append a trailing slash to the path to avoid losing the trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
;comment&lt;br /&gt;
:This parameter specifies a description string that is displayed next to the module name when clients obtain a list of available modules. The default is no comment.&lt;br /&gt;
&lt;br /&gt;
;uid&lt;br /&gt;
:This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the &amp;amp;quot;gid&amp;amp;quot; parameter this determines what file permissions are available. The default when run by a super-user is to switch to the system&#039;s &amp;amp;quot;nobody&amp;amp;quot; user. The default for a non-super-user is to not try to change the user. See also the &amp;amp;quot;gid&amp;amp;quot; parameter. The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user. For example, if you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;uid = %RSYNC_USER_NAME%&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;gid = *&amp;lt;/pre&amp;gt;&lt;br /&gt;
;gid&lt;br /&gt;
:This parameter specifies one or more group names/IDs that will be used when accessing the module. The first one will be the default group, and any extra ones be set as supplemental groups. You may also specify a &amp;amp;quot;*&amp;amp;quot; as the first gid in the list, which will be replaced by all the normal groups for the transfer&#039;s user (see &amp;amp;quot;uid&amp;amp;quot;). The default when run by a super-user is to switch to your OS&#039;s &amp;amp;quot;nobody&amp;amp;quot; (or perhaps &amp;amp;quot;nogroup&amp;amp;quot;) group with no other supplementary groups. The default for a non-super-user is to not change any group attributes (and indeed, your OS may not allow a non-super-user to try to change their group settings).&lt;br /&gt;
&lt;br /&gt;
;read only&lt;br /&gt;
:This parameter determines whether clients will be able to upload files or not. If &amp;amp;quot;read only&amp;amp;quot; is true then any attempted uploads will fail. If &amp;amp;quot;read only&amp;amp;quot; is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only. Note that &amp;amp;quot;auth users&amp;amp;quot; can override this setting on a per-user basis.&lt;br /&gt;
&lt;br /&gt;
;list&lt;br /&gt;
:This parameter determines whether this module is listed when the client asks for a listing of available modules. In addition, if this is false, the daemon will pretend the module does not exist when a client denied by &amp;amp;quot;hosts allow&amp;amp;quot; or &amp;amp;quot;hosts deny&amp;amp;quot; attempts to access it. Realize that if &amp;amp;quot;reverse lookup&amp;amp;quot; is disabled globally but enabled for the module, the resulting reverse lookup to a potentially client-controlled DNS server may still reveal to the client that it hit an existing module. The default is for modules to be listable.&lt;br /&gt;
&lt;br /&gt;
;auth users&lt;br /&gt;
:This parameter specifies a comma and/or space-separated list of authorization rules. In its simplest form, you list the usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The rules may contain shell wildcard characters that will be matched against the username provided by the client for authentication. If &amp;amp;quot;auth users&amp;amp;quot; is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the &amp;amp;quot;secrets file&amp;amp;quot; parameter. The default is for all users to be able to connect without a password (this is called &amp;amp;quot;anonymous rsync&amp;amp;quot;). In addition to username matching, you can specify groupname matching via a &#039;@&#039; prefix. When using groupname matching, the authenticating username must be a real user on the system, or it will be assumed to be a member of no groups. For example, specifying &amp;amp;quot;@rsync&amp;amp;quot; will match the authenticating user if the named user is a member of the rsync group.&lt;br /&gt;
&lt;br /&gt;
:Finally, options may be specified after a colon (:). The options allow you to &amp;amp;quot;deny&amp;amp;quot; a user or a group, set the access to &amp;amp;quot;ro&amp;amp;quot; (read-only), or set the access to &amp;amp;quot;rw&amp;amp;quot; (read/write). Setting an auth-rule-specific ro/rw setting overrides the module&#039;s &amp;amp;quot;read only&amp;amp;quot; setting.&lt;br /&gt;
&lt;br /&gt;
:Be sure to put the rules in the order you want them to be matched, because the checking stops at the first matching user or group, and that is the only auth that is checked. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above rule, user joe will be denied access no matter what. Any user that is in the group &amp;amp;quot;guest&amp;amp;quot; is also denied access. The user &amp;amp;quot;admin&amp;amp;quot; gets access in read/write mode, but only if the admin user is not in group &amp;amp;quot;guest&amp;amp;quot; (because the admin user-matching rule would never be reached if the user is in group &amp;amp;quot;guest&amp;amp;quot;). Any other user who is in group &amp;amp;quot;rsync&amp;amp;quot; will get read-only access. Finally, users susan, joe, and sam get the ro/rw setting of the module, but only if the user didn&#039;t match an earlier group-matching rule.&lt;br /&gt;
&lt;br /&gt;
:If you need to specify a user or group name with a space in it, start your list with a comma to indicate that the list should only be split on commas (though leading and trailing whitespace will also be removed, and empty entries are just ignored). For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro&amp;lt;/pre&amp;gt;&lt;br /&gt;
:See the description of the secrets file for how you can have per-user passwords as well as per-group passwords. It also explains how a user can authenticate using their user password or (when applicable) a group password, depending on what rule is being authenticated.&lt;br /&gt;
&lt;br /&gt;
:See also the section entitled &amp;amp;quot;USING RSYNC-DAEMON FEATURES VIA A REMOTE SHELL CONNECTION&amp;amp;quot; in [https://download.samba.org/pub/rsync/rsyncd.conf.html rsync] for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.&lt;br /&gt;
&lt;br /&gt;
;secrets file&lt;br /&gt;
:This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the &amp;amp;quot;auth users&amp;amp;quot; parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don&#039;t work. The use of group-specific lines are only relevant when the module is being authorized using a matching &amp;amp;quot;@groupname&amp;amp;quot; rule. When that happens, the user can be authorized via either their &amp;amp;quot;username:password&amp;amp;quot; line or the &amp;amp;quot;@groupname:password&amp;amp;quot; line for the group that triggered the authentication.&lt;br /&gt;
&lt;br /&gt;
:It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in &amp;amp;quot;auth users&amp;amp;quot; does not require that you specify a group password if you do not want to use shared passwords.&lt;br /&gt;
&lt;br /&gt;
:There is no default for the &amp;amp;quot;secrets file&amp;amp;quot; parameter, you must choose a name (such as &amp;lt;code&amp;gt;/etc/rsyncd.secrets&amp;lt;/code&amp;gt;). The file must normally not be readable by &amp;amp;quot;other&amp;amp;quot;; see &amp;amp;quot;strict modes&amp;amp;quot;. If the file is not found or is rejected, no logins for a &amp;amp;quot;user auth&amp;amp;quot; module will be possible.&lt;br /&gt;
&lt;br /&gt;
;hosts allow&lt;br /&gt;
:This parameter allows you to specify a list of comma- and/or whitespace-separated patterns that are matched against a connecting client&#039;s hostname and IP address. If none of the patterns match, then the connection is rejected. Each pattern can be in one of five forms:&lt;br /&gt;
&lt;br /&gt;
:* a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of the form a:b:c::d:e:f. In this case the incoming machine&#039;s IP address must match exactly.&lt;br /&gt;
:* an address/mask in the form ipaddr/n where ipaddr is the IP address and n is the number of one bits in the netmask. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* an address/mask in the form ipaddr/maskaddr where ipaddr is the IP address and maskaddr is the netmask in dotted decimal notation for IPv4, or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP addresses which match the masked IP address will be allowed in.&lt;br /&gt;
:* a hostname pattern using wildcards. If the hostname of the connecting IP (as determined by a reverse lookup) matches the wildcarded name (using the same rules as normal unix filename matching), the client is allowed in. This only works if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled (the default).&lt;br /&gt;
:* a hostname. A plain hostname is matched against the reverse DNS of the connecting IP (if &amp;amp;quot;reverse lookup&amp;amp;quot; is enabled), and/or the IP of the given hostname is matched against the connecting IP (if &amp;amp;quot;forward lookup&amp;amp;quot; is enabled, as it is by default). Any match will be allowed in.&lt;br /&gt;
&lt;br /&gt;
:Note IPv6 link-local addresses can have a scope in the address specification:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::1%link1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/64&amp;lt;/pre&amp;gt;&lt;br /&gt;
:&amp;lt;pre&amp;gt;fe80::%link1/ffff:ffff:ffff:ffff::&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You can also combine &amp;amp;quot;hosts allow&amp;amp;quot; with a separate &amp;amp;quot;hosts deny&amp;amp;quot; parameter. If both parameters are specified then the &amp;amp;quot;hosts allow&amp;amp;quot; parameter is checked first and a match results in the client being able to connect. The &amp;amp;quot;hosts deny&amp;amp;quot; parameter is then checked and a match means that the host is rejected. If the host does not match either the &amp;amp;quot;hosts allow&amp;amp;quot; or the &amp;amp;quot;hosts deny&amp;amp;quot; patterns then it is allowed to connect.&lt;br /&gt;
&lt;br /&gt;
:The default is no &amp;amp;quot;hosts allow&amp;amp;quot; parameter, which means all hosts can connect.&lt;br /&gt;
&lt;br /&gt;
;refuse options&lt;br /&gt;
:This parameter allows you to specify a space-separated list of rsync command line options that will be refused by your rsync daemon. You may specify the full option name, its one-letter abbreviation, or a wild-card string that matches multiple options. For example, this would refuse &#039;&#039;&#039;--checksum (-c)&#039;&#039;&#039; and all the various delete options:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;  refuse options = c delete&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The reason the above refuses all delete options is that the options imply &#039;&#039;&#039;--delete&#039;&#039;&#039;, and implied options are refused just like explicit options. As an additional safety feature, the refusal of &amp;amp;quot;delete&amp;amp;quot; also refuses &#039;&#039;&#039;remove-source-files&#039;&#039;&#039; when the daemon is the sender; if you want the latter without the former, instead refuse &amp;amp;quot;delete-&#039;&#039;&#039;&amp;amp;quot; -- that refuses all the delete modes without affecting &#039;&#039;&#039;--remove-source-files*.&lt;br /&gt;
&lt;br /&gt;
:When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use &amp;amp;quot;dont compress = *&amp;amp;quot; (see below) instead of &amp;amp;quot;refuse options = compress&amp;amp;quot; to avoid returning an error to a client that requests compression.&lt;br /&gt;
&lt;br /&gt;
;max connections&lt;br /&gt;
:This parameter allows you to specify the maximum number of simultaneous connections you will allow. Any clients connecting when the maximum has been reached will receive a message telling them to try later. The default is 0, which means no limit. A negative value disables the module. See also the &amp;amp;quot;lock file&amp;amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
;Eriks Ocakovskis C11, Estonian IT College, 07-05-2017&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Eocakovs</name></author>
	</entry>
</feed>