Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharne/rsync #316

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
17 changes: 17 additions & 0 deletions DC-copy-file-rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## ----------------------------
## Doc Config File for the DB Assembly
## ----------------------------
##
## Basics
MAIN="copy-file-with-rsync.asm.xml"
SRC_DIR="articles"
IMG_SRC_DIR="images"

## Profiling
PROFOS="generic"
#PROFARCH="x86_64;zseries;power;aarch64"

## stylesheet location
STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2022-ns"
FALLBACK_STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2021-ns"
DOCBOOK5_RNG_URI="urn:x-suse:rng:v2:geekodoc-flat"
208 changes: 208 additions & 0 deletions articles/copy-file-with-rsync.asm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- file: templates/articles/assembly.xml -->
<?xml-model href="https://cdn.docbook.org/schema/5.2/rng/assemblyxi.rnc"
type="application/relax-ng-compact-syntax"?>
<!DOCTYPE assembly
[
<!ENTITY % entities SYSTEM "../common/generic-entities.ent">
%entities;
]>
<!-- refers to legacy doc: <add github link to legacy doc piece, if applicable> -->
<!-- point back to this document with a similar comment added to your legacy doc piece -->
<!-- refer to README.md for file and id naming conventions -->
<assembly version="5.2" xml:lang="en"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:its="http://www.w3.org/2005/11/its"
xmlns="http://docbook.org/ns/docbook">
<!-- resources section references all topic chunks used in the final article
-->
<!-- R E S O U R C E S -->
<!-- Glue files -->
<!--><resources>
<resource xml:id="_glue-example" href="../glues/glue.xml">
<description>Glue example</description>
</resource>
<resource xml:id="_glue-more-info" href="../glues/glue-more-info.xml">
<description>Glue for more information</description>
</resource>
<resource xml:id="_glue-whats-next" href="../glues/glue-whats-next.xml">
<description>Glue what's next</description>
</resource>
</resources>
-->
<!-- Concept files -->

<resources>
<resource xml:id="_copy-file-with-rsync-concept" href="../concepts/copy-file-with-rsync-concept.xml">
<description>Copying files using rsync</description>
</resource>
<resource xml:id="_copy-file-with-rsync-locally" href="../concepts/copy-file-with-rsync-locally.xml">
<description>Copying files and directories using rsync locally.</description>
</resource>
<resource xml:id="_copy-file-with-rsync-remotely" href="../concepts/copy-file-with-rsync-remotely.xml">
<description>Copying files and directories using rsync remotely.</description>
</resource>
<resource xml:id="_copy-file-with-rsync-usage" href="../concepts/copy-file-with-rsync-usage.xml">
<description>Use rsync to copy files and directories.</description>
</resource>
<resource xml:id="_copy-file-with-rsync-troubleshooting" href="../concepts/copy-file-with-rsync-troubleshooting.xml">
<description>The steps to follow if rsync fails to copy files or directories.</description>
</resource>
</resources>

<!-- Tasks -->

<resources>

<resource xml:id="_copy-file-with-rsync-configure-rsync-server" href="../tasks/copy-file-with-rsyc-configure-rsync-server.xml">
<description>Use rsync to copy files and directories.</description>
</resource>

</resources>

<!-- References -->
<!--
<resources>
<resource xml:id="_reference-example" href="../references/reference.xml">
<description>Reference example</description>
</resource>
</resources>
-->
<!-- Legal -->
<resources>
<resource href="../common/legal.xml" xml:id="_legal">
<description>Legal Notice</description>
</resource>
<resource href="../common/license_gfdl1.2.xml" xml:id="_gfdl">
<description>GNU Free Documentation License</description>
</resource>
</resources>
<!-- S T R U C T U R E -->
<structure renderas="article" xml:id="article-example" xml:lang="en">
<merge>
<title>Copy files and directories using rsync</title>
<!-- <subtitle>Subtitle if necessary</subtitle> -->
<!-- Create changelog to enable versioning; add most recent entries at the top. -->
<revhistory>
<title>Changelog</title>
<revision><revnumber>1</revnumber><date>2024-03-15</date>
<revdescription>
<para>
Initial Draft
</para>
</revdescription>
</revision>
</revhistory>
<!-- TODO: provide a listing of possible and validatable meta entry values. Maybe in our geekodoc repo? -->
<!-- add author's e-mail -->
<meta name="Shalaka Harne" content="[email protected]" its:translate="no"/>
<!-- ISO date of last update as YYYY-MM-DD
<meta name="updated" content="2023-11-11" its:translate="no"/> -->
<!-- this does not work yet. Use the dm tags listed below for now
<meta name="bugtracker" its:translate="no">
<phrase role="url">https://bugzilla.suse.com/enter_bug.cgi</phrase>
<phrase role="component">Non-product-specific documentation</phrase>
<phrase role="product">Smart Docs</phrase>
<phrase role="assignee">[email protected]</phrase>
</meta>
-->
<!-- not supported, yet. Use dm: tag for now
<meta name="translation" its:translate="no">
<phrase role="trans">yes</phrase>
<phrase role="language">de-de,cs-cz</phrase>
</meta>
-->
<!-- enter the platform identifier or a list of
identifiers, separated by ; -->
<meta name="architecture" content="x86;power" its:translate="no"/>
<meta name="productname" its:translate="no">
<!-- enter product name and version --><productname version="15-SP5">&sles;</productname>
</meta>
<meta name="title" its:translate="yes">Copy files and directories using rsync command.</meta>
<meta name="description" its:translate="yes">An overview of copying files and directories locally and remotely using rsync.</meta>
<meta name="social-descr" its:translate="yes">File copy using rsync</meta>
<!-- suitable category, comma-separated list of categories -->
<meta name="category" content="Systems Management" its:translate="no"/>
<dm:docmanager xmlns:dm="urn:x-suse:ns:docmanager">
<dm:bugtracker>
<dm:url>https://bugzilla.suse.com/enter_bug.cgi</dm:url>
<dm:component>Smart Docs</dm:component>
<dm:product>Documentation</dm:product>
<dm:assignee>[email protected]</dm:assignee>
</dm:bugtracker>
<dm:translation>yes</dm:translation>
</dm:docmanager>
<abstract>
<variablelist>
<varlistentry>
<term>WHAT?</term>
<listitem>
<para>
You can use rsync tool to copy files locally or remotely. rsync is unidirectional and can copy files only in one direction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>WHY?</term>
<listitem>
<para>
This article provides an overview of the rsync tool and basic usage of the tool for copying files locally and remotely.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>EFFORT</term>
<listitem>
<para>
It takes upto 20 minutes to understand the basic usage of the rsync tool.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>GOAL</term>
<listitem>
<para>
Basic understanding of the rsync tool and knowledge to use the tool.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>REQUIREMENTS</term>
<listitem>
<para>
Access permissions to the source and destination locations for copying files.
</para>
</listitem>
</varlistentry>
</variablelist>
</abstract>
</merge>
<!-- pull in all the topic files you need -->
<!-- pick the appropriate type of include to match your needs -->
<!-- pull in a topic as is -->
<!--module resourceref="_glue-example" renderas="section"/>
<! pull in a topic and switch the title
<module resourceref="_concept-example" renderas="section">
<merge>
<title>You are a very special concept now!</title>
</merge>
</module>-->
<!--module resourceref="_task-example" renderas="section"/>
<module resourceref="_reference-example" renderas="section"/>
<module resourceref="_glue-more-info" renderas="section"/>
<module resourceref="_glue-whats-next" renderas="section"/>-->
<module resourceref="_copy-file-with-rsync-concept" renderas="section"/>
<!--module resourceref="_copy-file-with-rsync-usage" renderas="section"/>-->
<module resourceref="_copy-file-with-rsync-usage" renderas="section"/>
<module resourceref="_copy-file-with-rsync-locally" renderas="section"/>
<module resourceref="_copy-file-with-rsync-remotely" renderas="section"/>

<module resourceref="_copy-file-with-rsync-configure-rsync-server" renderas="section"/>
<module resourceref="_copy-file-with-rsync-troubleshooting" renderas="section"/>
<module resourceref="_legal"/>
<module resourceref="_gfdl">
<output renderas="appendix"/>
</module>
</structure>
</assembly>
3 changes: 2 additions & 1 deletion articles/freeradius-setup-server.asm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@

<resource href="../tasks/freeradius-setup-server-create-test-certificates.xml" xml:id="_freeradius-setup-server-create-test-certificates"></resource>
<resource href="../tasks/freeradius-setup-server-add-client-user.xml" xml:id="_freeradius-setup-server-add-client-user"></resource>
<resource href="../tasks/freeradius-setup-server-start-server.xml" xml:id="_freeradius-setup-server-start-freeradius"></resource>
<resource href="../tasks/freeradius-setup-server-start-server.xml" xml:id="_freeradius-setup-server-start-server"></resource>
<resource href="../tasks/freeradius-setup-server-start-freeradius.xml" xml:id="_freeradius-setup-server-start-freeradius"></resource>
<resource href="../tasks/freeradius-setup-server-test-authentication.xml" xml:id="_freeradius-setup-server-test"></resource>
</resources>
<!-- References -->
Expand Down
4 changes: 2 additions & 2 deletions articles/manage-vm-on-commandline.asm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<!-- TODO: provide a listing of possible and validatable meta entry values. Maybe in our geekodoc repo? -->
<!-- add author's e-mail -->
<meta name="maintainer" content="[email protected]" its:translate="no"/>
<!-- ISO date of last update as YYYY-MM-DD -->
<meta name="updated" content="2023-09-19" its:translate="no"/>
<!-- ISO date of last update as YYYY-MM-DD
<meta name="updated" content="2023-09-19" its:translate="no"/>-->
<!-- this does not work yet. Use the dm tags listed below for now
<meta name="bugtracker" its:translate="no">
<phrase role="url">https://bugzilla.suse.com/enter_bug.cgi</phrase>
Expand Down
27 changes: 27 additions & 0 deletions concepts/copy-file-with-rsync-concept.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
[
<!ENTITY % entities SYSTEM "../common/generic-entities.ent">
%entities;
]>
<!-- refers to https://github.com/SUSE/doc-sle/blob/main/xml/systemd.xml [sec-boot-systemd-timer-units] -->
<topic xml:id="copy-file-using-rsync-concept"
role="concept" xml:lang="en"
xmlns="http://docbook.org/ns/docbook" version="5.2"
xmlns:its="http://www.w3.org/2005/11/its"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:trans="http://docbook.org/ns/transclusion">
<info>
<title>The rsync concept</title>
<meta name="maintainer" content="[email protected]" its:translate="no"/>
<abstract>
<para>
You can use the <literal>rsync</literal> tool for transferring or copying files locally and remotely. <literal>rsync</literal> is unidirectional and it copies files only in one direction, it does not synchronize data.
Instead of transmitting all the contents in the file, <literal>rsync</literal> minimizes the amount of data copied by moving only the changes within the file. Hence, this supports transfer of data over slow network connection.</para>
</abstract>
</info>
<para>For copying large files using <literal>rsync</literal>, detecting changes requires certain computing power. So ensure that machines on both source and destination have enough resources, including RAM. </para>
<para>You can use rsync when large amount of data containing only minor changes need to be transmitted regularly. Hence, this is useful when working with backups. <literal>rsync</literal> can also be useful for mirroring staging servers that store complete directory trees of Web servers to a Web server in a DMZ.</para>
<para>This article includes examples that shows the usage of the <literal>rsync</literal> to copy files locally and remotely. This document also explains how to configure and use an <literal>rsync</literal> server.</para>
</topic>
26 changes: 26 additions & 0 deletions concepts/copy-file-with-rsync-locally.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
[
<!ENTITY % entities SYSTEM "../common/generic-entities.ent">
%entities;
]>
<!-- refers to https://github.com/SUSE/doc-sle/blob/main/xml/systemd.xml [sec-boot-systemd-timer-units] -->
<topic xml:id="copy-file-using-rsync-locally"
role="concept" xml:lang="en"
xmlns="http://docbook.org/ns/docbook" version="5.2"
xmlns:its="http://www.w3.org/2005/11/its"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:trans="http://docbook.org/ns/transclusion">
<info>
<title>Copying files and directories with rsync locally</title>
<meta name="maintainer" content="[email protected]" its:translate="no"/>
<abstract>
<para>You can copy files within the same machine using rsync if you have write permission for the destination location.</para></abstract>

</info>
<para>For example to copy file <filename>backup.tar.xz</filename> to the location <filename>/var/backup/</filename>, use the following command: </para>
<screen>rsync -avz backup.tar.xz /var/backup/</screen>
<para>The file <filename>backup.tar.xz</filename> is copied to <filename>/var/backup/</filename>; the absolute path is<filename>/var/backup/backup.tar.xz</filename>.</para>

</topic>
27 changes: 27 additions & 0 deletions concepts/copy-file-with-rsync-remotely.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
[
<!ENTITY % entities SYSTEM "../common/generic-entities.ent">
%entities;
]>
<!-- refers to https://github.com/SUSE/doc-sle/blob/main/xml/systemd.xml [sec-boot-systemd-timer-units] -->
<topic xml:id="copy-file-using-rsync-remotely"
role="concept" xml:lang="en"
xmlns="http://docbook.org/ns/docbook" version="5.2"
xmlns:its="http://www.w3.org/2005/11/its"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:trans="http://docbook.org/ns/transclusion">
<info>
<title>Copying files and directories with rsync remotely</title>
<meta name="maintainer" content="[email protected]" its:translate="no"/>
<abstract>
<para>You can copy files from one machine to a remote machine using rsync. Ensure that you have rsync in both source and destination machines and that you are connected to the remote machine over SSH.</para></abstract>
</info>
<para>To copy a single file from one directory on your machine to <filename>/var/backup</filename>, use the following command:</para>
<screen>rsync -avz tux /var/backup/</screen>
<note><para>Ensure that you add the trailing slash after the<filename>/var/backup/</filename> directory. If you do not insert the slash, the file backup.tar.xz is copied to <filename>/var/backup</filename> file and not inside the directory <filename>/var/backup/</filename>.</para></note>
<para>Verify the copied file in the absolute path <filename>/var/backup/backup.tar.xz.</filename></para>
<para>To copy the directory <filename>tux/</filename> and its content into the directory <filename>/var/backup/</filename>
</para><screen>rsync -avz tux /var/backup/</screen>
<para>Verify the copied directory in the absolute path <filename>/var/backup/tux/</filename>. </para></topic>
49 changes: 49 additions & 0 deletions concepts/copy-file-with-rsync-troubleshooting.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
[
<!ENTITY % entities SYSTEM "../common/generic-entities.ent">
%entities;
]>
<!-- refers to https://github.com/SUSE/doc-sle/blob/main/xml/systemd.xml [sec-boot-systemd-timer-units] -->
<topic xml:id="copy-file-using-rsync-troubleshooting"
role="concept" xml:lang="en"
xmlns="http://docbook.org/ns/docbook" version="5.2"
xmlns:its="http://www.w3.org/2005/11/its"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:trans="http://docbook.org/ns/transclusion">
<info>
<title>Troubleshooting rsync</title>
<meta name="maintainer" content="[email protected]" its:translate="no"/>
<abstract><para>
File or folder copying may fail due to several reasons. Ensure that you have the required permissions and resources to perform the file copy.</para></abstract>
</info>
<para>Possible troubleshooting methods are mentioned below:</para>
<itemizedlist>
<listitem>
<para>
Ensure that you have the latest version of rsync.
</para>
</listitem>
<listitem>
<para>
Ensure that you have the required rsync access permission.
</para>
</listitem>
<listitem>
<para>
Ensure that the specified hostname corresponds to the correct storage location (Example, <varname>vny</varname>, <varname>cpm</varname>, or <varname>ams</varname>). The rsync hostname assigned to your account is listed on the RSYNC page.</para>
</listitem>
<listitem>
<para>
Ensure that the command used to transfer your content matches the syntax defined below.
</para><screen>rsync -avp {Local Path} {User Name}@rsync.yyy.AN.{Base Domain}:{Destination Path}</screen>
</listitem>
<listitem><para>Ensure that the {Local path} points to an existing folder on your system.</para></listitem>
<listitem>
<para>Ensure that {Destination Path} starts with a forward slash.
</para>
<screen>/DestinationFolder</screen>
</listitem>
</itemizedlist>
</topic>
Loading
Loading