From ae4a73c37a372e55ab9f5fe0f63a8a82b30afd41 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Thu, 12 Oct 2023 19:13:33 +0530 Subject: [PATCH 01/14] Fixed error --- articles/freeradius-setup-server.asm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/articles/freeradius-setup-server.asm.xml b/articles/freeradius-setup-server.asm.xml index 18946bc20..4cfdf1f67 100644 --- a/articles/freeradius-setup-server.asm.xml +++ b/articles/freeradius-setup-server.asm.xml @@ -48,7 +48,8 @@ - + + From cea0e305fb1f0d056ae1db9bfabbcaf1ad0b99d0 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Wed, 17 Jan 2024 08:17:51 +0530 Subject: [PATCH 02/14] Added new files for rsynch Smartdocs --- DC-copy-file-rsync | 17 ++ articles/copy-file-with-rsync.asm.xml | 191 ++++++++++++++++++ articles/manage-vm-on-commandline.asm.xml | 4 +- concepts/manage-vm-on-commandline-concept.xml | 4 +- 4 files changed, 212 insertions(+), 4 deletions(-) create mode 100644 DC-copy-file-rsync create mode 100644 articles/copy-file-with-rsync.asm.xml diff --git a/DC-copy-file-rsync b/DC-copy-file-rsync new file mode 100644 index 000000000..77e0e4cd1 --- /dev/null +++ b/DC-copy-file-rsync @@ -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" diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml new file mode 100644 index 000000000..b1686fac0 --- /dev/null +++ b/articles/copy-file-with-rsync.asm.xml @@ -0,0 +1,191 @@ + + + + + %entities; +]> + + + + + + + + + + Glue example + + + Glue for more information + + + Glue what's next + + +--> + + + + + + + + + + + Legal Notice + + + GNU Free Documentation License + + + + + + Copy Files using rsync command + + + + Changelog + 12024-01-08 + + + Initial Draft + + + + + + + + + + + + + + &sles; + + Copy files and directories using rsync command. + An overview of copying files and directories using rsynch command. + File copy using rsync + + + + + https://bugzilla.suse.com/enter_bug.cgi + Smart Docs + Documentation + shalaka.harne@suse.com + + yes + + + + + WHAT? + + + Describe your topic in one sentence. + + + + + WHY? + + + State the reason why one should read this. + + + + + EFFORT + + + What's the effort one has to put in? + + + + + GOAL + + + What's the reader's take-away from this article? + + + + + REQUIREMENTS + + + + + List the requirements to accomplish the task(s) described below. + + + + + + + + + + + + + + + + You are a very special concept now! + + + + + + + + + + + + diff --git a/articles/manage-vm-on-commandline.asm.xml b/articles/manage-vm-on-commandline.asm.xml index f5662764d..0e262a607 100644 --- a/articles/manage-vm-on-commandline.asm.xml +++ b/articles/manage-vm-on-commandline.asm.xml @@ -83,8 +83,8 @@ - - + &sles; Copy files and directories using rsync command. - An overview of copying files and directories using rsynch command. + An overview of copying files locally and remotely using rsync. File copy using rsync @@ -126,7 +126,7 @@ WHAT? - Describe your topic in one sentence. + You can use rsync tool to copy files locally or remotely. rsync is unidirectional and can copy files only in one direction. @@ -134,7 +134,7 @@ WHY? - State the reason why one should read this. + This article provides an overview of the rsync tool and basic usage of the tool for copying files locally and remotely. @@ -142,7 +142,7 @@ EFFORT - What's the effort one has to put in? + It takes upto 20 minutes to understand the basic usage of the rsync tool. @@ -150,7 +150,7 @@ GOAL - What's the reader's take-away from this article? + Basic understanding of the rsync tool and knowledge to use the tool. @@ -160,7 +160,7 @@ - List the requirements to accomplish the task(s) described below. + Access permissions to the source and destination locations for copying files. diff --git a/concepts/copy-file-with-rsync-concept.xml b/concepts/copy-file-with-rsync-concept.xml new file mode 100644 index 000000000..b65a591c0 --- /dev/null +++ b/concepts/copy-file-with-rsync-concept.xml @@ -0,0 +1,38 @@ + + +%entities; +]> + + + + The rsync concept + + + + Files stored in multiple devices or directories must be in synchronization with each other to ensure accuracy and maintainability of data. rsync is a tool used for transferring or copying files locally and remotely. rsync is unidirectional and it copies files only in one direction, it does not synchronize data. +Instead of transmitting all the contents in the file, rsync minimizes the amount of data copied by moving only the changes within the file. Hence, this supports transfer of data over slow network connection. + + + To use rsync for large files, detecting changes requires certain computing power. So ensure that machines on both source and destination have enough resources, including RAM. +You can use rsync when large amounts of data containing only minor changes need to be transmitted regularly. Hence, this is useful when working with backups. rsync can also be useful for mirroring staging servers that store complete directory trees of Web servers to a Web server in a DMZ. +
+ FreeRADIUS Architecture + + + + + + + + +
+This article includes examples that shows the usage of the rsync command to copy files locally and remotely. This document also explains how to configure and use an rsync server. +
From b57bad877256a94e153a79b74425d4a2be053bbe Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Mon, 18 Mar 2024 14:29:37 +0530 Subject: [PATCH 04/14] Added content --- articles/copy-file-with-rsync.asm.xml | 26 +++++----- concepts/copy-file-with-rsync-locally.xml | 26 ++++++++++ concepts/copy-file-with-rsync-remotely.xml | 27 ++++++++++ tasks/copy-file-with-rsyc-usage.xml | 58 ++++++++++++++++++++++ 4 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 concepts/copy-file-with-rsync-locally.xml create mode 100644 concepts/copy-file-with-rsync-remotely.xml create mode 100644 tasks/copy-file-with-rsyc-usage.xml diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml index 088840fbe..07696c356 100644 --- a/articles/copy-file-with-rsync.asm.xml +++ b/articles/copy-file-with-rsync.asm.xml @@ -32,13 +32,15 @@ --> - + Changelog - 12024-01-08 + 12024-03-15 Initial Draft @@ -172,18 +174,18 @@ - - + + + diff --git a/concepts/copy-file-with-rsync-locally.xml b/concepts/copy-file-with-rsync-locally.xml new file mode 100644 index 000000000..1bcc788d5 --- /dev/null +++ b/concepts/copy-file-with-rsync-locally.xml @@ -0,0 +1,26 @@ + + +%entities; +]> + + + + Copying files and directories with &rsync; locally + + + You can copy files within the same machine using &rsync;. + Ensure that you have write access to the destination location. + + To copy file to the location /var/backup, use the following command: + rsync -avz backup.tar.xz /var/backup/ + The file backup.tar.xz is copied to /var/backup/; the absolute path will be /var/backup/backup.tar.xz. + + diff --git a/concepts/copy-file-with-rsync-remotely.xml b/concepts/copy-file-with-rsync-remotely.xml new file mode 100644 index 000000000..352f13a2e --- /dev/null +++ b/concepts/copy-file-with-rsync-remotely.xml @@ -0,0 +1,27 @@ + + +%entities; +]> + + + + Copying files and directories with &rsync; remotely + + + 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. + + To copy a single file from one directory on your machine to /var/backup, use the following command: + rsync -avz tux /var/backup/ + Ensure that you add the trailing slash after the/var/backup/ directory. If you do not insert the slash, the file backup.tar.xz is copied to /var/backup (file) not inside the directory /var/backup/. +Verify the copied file in the absolute path /var/backup/backup.tar.xz. +To copy the directory tux/ and its content into the directory /var/backup/ +rsync -avz tux /var/backup/ +Verify the copied directory in the absolute path /var/backup/tux/. diff --git a/tasks/copy-file-with-rsyc-usage.xml b/tasks/copy-file-with-rsyc-usage.xml new file mode 100644 index 000000000..be68f6554 --- /dev/null +++ b/tasks/copy-file-with-rsyc-usage.xml @@ -0,0 +1,58 @@ + + + %entities; +]> + + + + + + + Using &rsync; + + + + + You can use &rsync; on any remote machine you have access and write permissions. + + + Using &rsync; + Copy files from source location to destination location by using the following example: + + Run the following command. + rsync [OPTION] SOURCE [SOURCE]... DESTINATION + You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. + The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. + The commonly used OPTIONS are listed below: + + + + + -V + Outputs more verbose text. + + + + -a + Archive mode; copies files recursively and preserves time stamps, user/group ownership, file permissions, and symbolic links. + + -z + Compresses the transmitted data. + -n or --dry-run + Performs a trial run with no changes made. + -r + recurse into directories + --progress + show progress during transfer + + + \ No newline at end of file From 51bd9abefdeec810f1da88ca581deda9a85fe9d5 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Tue, 19 Mar 2024 10:00:09 +0530 Subject: [PATCH 05/14] updated content --- articles/copy-file-with-rsync.asm.xml | 25 +++++--- concepts/copy-file-with-rsync-concept.xml | 13 +---- concepts/copy-file-with-rsync-locally.xml | 10 ++-- concepts/copy-file-with-rsync-remotely.xml | 6 +- ...-file-with-rsyc-configure-rsync-server.xml | 58 +++++++++++++++++++ 5 files changed, 83 insertions(+), 29 deletions(-) create mode 100644 tasks/copy-file-with-rsyc-configure-rsync-server.xml diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml index 07696c356..c83121fcd 100644 --- a/articles/copy-file-with-rsync.asm.xml +++ b/articles/copy-file-with-rsync.asm.xml @@ -35,21 +35,24 @@ - Copying files using &rsync; + Copying files using rsync - - Copying files using &rsync; + + Copying files and directories using rsync locally. + + + Copying files and directories using rsync remotely. - - + --> + + + + + diff --git a/concepts/copy-file-with-rsync-concept.xml b/concepts/copy-file-with-rsync-concept.xml index b65a591c0..5944e9867 100644 --- a/concepts/copy-file-with-rsync-concept.xml +++ b/concepts/copy-file-with-rsync-concept.xml @@ -5,7 +5,7 @@ %entities; ]> - To use rsync for large files, detecting changes requires certain computing power. So ensure that machines on both source and destination have enough resources, including RAM. You can use rsync when large amounts of data containing only minor changes need to be transmitted regularly. Hence, this is useful when working with backups. rsync can also be useful for mirroring staging servers that store complete directory trees of Web servers to a Web server in a DMZ. -
- FreeRADIUS Architecture - - - - - - - - -
This article includes examples that shows the usage of the rsync command to copy files locally and remotely. This document also explains how to configure and use an rsync server.
diff --git a/concepts/copy-file-with-rsync-locally.xml b/concepts/copy-file-with-rsync-locally.xml index 1bcc788d5..a1bc4228a 100644 --- a/concepts/copy-file-with-rsync-locally.xml +++ b/concepts/copy-file-with-rsync-locally.xml @@ -13,14 +13,14 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Copying files and directories with &rsync; locally + Copying files and directories with rsync locally - You can copy files within the same machine using &rsync;. - Ensure that you have write access to the destination location. + You can copy files within the same machine using rsync if you have write permission for the destination location. + To copy file to the location /var/backup, use the following command: - rsync -avz backup.tar.xz /var/backup/ - The file backup.tar.xz is copied to /var/backup/; the absolute path will be /var/backup/backup.tar.xz. +
rsync -avz backup.tar.xz /var/backup/ + The file backup.tar.xz is copied to /var/backup/; the absolute path is/var/backup/backup.tar.xz. diff --git a/concepts/copy-file-with-rsync-remotely.xml b/concepts/copy-file-with-rsync-remotely.xml index 352f13a2e..0dccee30e 100644 --- a/concepts/copy-file-with-rsync-remotely.xml +++ b/concepts/copy-file-with-rsync-remotely.xml @@ -13,15 +13,15 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Copying files and directories with &rsync; remotely + Copying files and directories with rsync remotely - 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. + 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. To copy a single file from one directory on your machine to /var/backup, use the following command: rsync -avz tux /var/backup/ Ensure that you add the trailing slash after the/var/backup/ directory. If you do not insert the slash, the file backup.tar.xz is copied to /var/backup (file) not inside the directory /var/backup/. Verify the copied file in the absolute path /var/backup/backup.tar.xz. To copy the directory tux/ and its content into the directory /var/backup/ -rsync -avz tux /var/backup/ +rsync -avz tux /var/backup/ Verify the copied directory in the absolute path /var/backup/tux/. diff --git a/tasks/copy-file-with-rsyc-configure-rsync-server.xml b/tasks/copy-file-with-rsyc-configure-rsync-server.xml new file mode 100644 index 000000000..e8baa48c2 --- /dev/null +++ b/tasks/copy-file-with-rsyc-configure-rsync-server.xml @@ -0,0 +1,58 @@ + + + %entities; +]> + + + + + + + Using &rsync; + + + + + You can use &rsync; on any remote machine you have access and write permissions. + + + Using &rsync; + Copy files from source location to destination location by using the following example: + + Run the following command. + rsync [OPTION] SOURCE [SOURCE]... DESTINATION + You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. + The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. + The commonly used OPTIONS are listed below: + + + + + -V + Outputs more verbose text. + + + + -a + Archive mode; copies files recursively and preserves time stamps, user/group ownership, file permissions, and symbolic links. + + -z + Compresses the transmitted data. + -n or --dry-run + Performs a trial run with no changes made. + -r + recurse into directories + --progress + show progress during transfer + + + \ No newline at end of file From 1878203648165e0ce0b8aaaab91f66ea42b5d365 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Thu, 21 Mar 2024 11:50:58 +0530 Subject: [PATCH 06/14] Updated content. --- articles/copy-file-with-rsync.asm.xml | 16 ++- concepts/copy-file-with-rsync-usage.xml | 45 +++++++ ...-file-with-rsyc-configure-rsync-server.xml | 118 +++++++++++++----- tasks/copy-file-with-rsyc-usage.xml | 12 +- 4 files changed, 148 insertions(+), 43 deletions(-) create mode 100644 concepts/copy-file-with-rsync-usage.xml diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml index c83121fcd..aa60c8dd5 100644 --- a/articles/copy-file-with-rsync.asm.xml +++ b/articles/copy-file-with-rsync.asm.xml @@ -42,16 +42,21 @@ Copying files and directories using rsync remotely. + + + Use rsync to copy files and directories. - - + + Use rsync to copy files and directories. - --> + + - + + + + diff --git a/concepts/copy-file-with-rsync-usage.xml b/concepts/copy-file-with-rsync-usage.xml new file mode 100644 index 000000000..e56ee4486 --- /dev/null +++ b/concepts/copy-file-with-rsync-usage.xml @@ -0,0 +1,45 @@ + + +%entities; +]> + + + + Copy files with rsync + + + You can use rsync on any remote machine you have access and write permissions. + + Copy files from source location to destination location by using the following example: + Run the following command. + rsync [OPTION] SOURCE [SOURCE]... DESTINATION You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. + The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. + The commonly used OPTIONS are listed below: + + + + -V + Outputs more verbose text. + + + + -a + Archive mode; copies files recursively and preserves time stamps, user/group ownership, file permissions, and symbolic links. + + -z + Compresses the transmitted data. + -n or --dry-run + Performs a trial run with no changes made. + -r + recurse into directories + --progress + show progress during transfer + diff --git a/tasks/copy-file-with-rsyc-configure-rsync-server.xml b/tasks/copy-file-with-rsyc-configure-rsync-server.xml index e8baa48c2..74def84c4 100644 --- a/tasks/copy-file-with-rsyc-configure-rsync-server.xml +++ b/tasks/copy-file-with-rsyc-configure-rsync-server.xml @@ -8,7 +8,7 @@ - - Using &rsync; - You can use &rsync; on any remote machine you have access and write permissions. + You can run rsync as a daemon rsyncd listening on default port 873 for incoming connections. This daemon can receive copying targets. - Using &rsync; - Copy files from source location to destination location by using the following example: - - Run the following command. - rsync [OPTION] SOURCE [SOURCE]... DESTINATION - You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. - The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. - The commonly used OPTIONS are listed below: - - - - - -V - Outputs more verbose text. - - - - -a - Archive mode; copies files recursively and preserves time stamps, user/group ownership, file permissions, and symbolic links. - - -z - Compresses the transmitted data. - -n or --dry-run - Performs a trial run with no changes made. - -r - recurse into directories - --progress - show progress during transfer - + Using rsync + The following description explains how to create an rsync server on with a backup target. This target can be used to store your backups. To create an Rsync server, do the following: + + + On jupiter, create a directory /var/backup to store all your backup files. + mkdir /var/backup + Specify ownership: + In this example, the user tux in group users owns the directory. + chown tux.users /var/backup + + Configure the rsyncd daemon. + The configuration file is separated into a main file and certain modules which hold your backup target. This makes it easier to add additional targets later. You can store global values /etc/rsyncd.d/*.inc files, whereas your modules are placed in /etc/rsyncd.d/*.conf files: + Create a directory /etc/rsyncd.d/ + mkdir /etc/rsyncd.d/ + +In the main configuration file /etc/rsyncd.conf, add the following lines: +rsyncd.conf main configuration file + log file = /var/log/rsync.log + pid file = /var/lock/rsync.lock + merge /etc/rsyncd.d + include /etc/rsyncd.d +merge /etc/rsyncd.d merges global values from /etc/rsyncd.d/*.inc files into the main configuration file. +include /etc/rsyncd.d loads any modules (or targets) from /etc/rsyncd.d/*.conf files. These files must not contain any references to global values. + +Create your module or your backup target in the file /etc/rsyncd.d/backup.conf with the following lines: +ackup.conf: backup module + [backup] + + + uid = tux + + + gid = users + + + path = /var/backup + + + auth users = tux + + + secrets file = /etc/rsyncd.secrets + + + comment = Our backup target + In the given example: + [backup] is the backup target. You can use any name for the backup target. You may use a name according to its purpose and use the same name in your *.conf file. + uid = tux specifies the user name or group name that is used when the file transfer takes place. + gid = users defines the path to store your backups (from Step 1). + path = /var/backup defines the path to store your backups (from Step 1). + auth users = tux specifies a comma-separated list of allowed users. In its simplest form, it contains the user names that are allowed to connect to this module. In our case, only user tux is allowed. + secrets file = /etc/rsyncd.secrets specifies the path of a file that contains lines with user names and plain passwords. + + + + Create the /etc/rsyncd.secrets file with the following content and replace PASSPHRASE + # user:passwd + tux:PASSPHRASE + + Make sure the file is only readable by root: + chmod 0600 /etc/rsyncd.secrets + + + +Start and enable the rsyncd daemon with: +systemctl enable rsyncd + + systemctl start rsyncd + +Test the access to your rsync server: +rsync jupiter:: +A response similar to the following appears: +backup Our backup target +If the above response does not appear, verify your configuration file, firewall, and network settings. + - \ No newline at end of file + The above steps create an rsync server that you can use to store backups. The example also creates a log file listing all connections. This file is stored in /var/log/rsyncd.log. This is useful to debug your transfers. + To list the content of your backup target, use the following command: + rsync -avz jupiter::backup + This command lists all files present in the directory /var/backup on the server. This request is also logged in the log file /var/log/rsyncd.log. To start an actual transfer, provide a source directory. Use . for the current directory. For example, the following command copies the current directory to your rsync backup server: + rsync -avz . jupiter::backup + By default, rsync does not delete files and directories when it runs. To enable deletion, the additional option must be stated. To ensure that no newer files are deleted, the option can be used instead. Any conflicts that arise must be resolved manually. + \ No newline at end of file diff --git a/tasks/copy-file-with-rsyc-usage.xml b/tasks/copy-file-with-rsyc-usage.xml index be68f6554..be6f6f984 100644 --- a/tasks/copy-file-with-rsyc-usage.xml +++ b/tasks/copy-file-with-rsyc-usage.xml @@ -29,12 +29,11 @@ in the assembly --> Copy files from source location to destination location by using the following example: Run the following command. - rsync [OPTION] SOURCE [SOURCE]... DESTINATION - You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. - The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. + rsync [OPTION] SOURCE [SOURCE]... DESTINATION You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. + + The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. The commonly used OPTIONS are listed below: - - + -V @@ -53,6 +52,7 @@ in the assembly --> recurse into directories --progress show progress during transfer - + + \ No newline at end of file From 43c1a4759e703a75e44d8c16148b87665f87429d Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Thu, 21 Mar 2024 15:45:33 +0530 Subject: [PATCH 07/14] Updated content --- articles/copy-file-with-rsync.asm.xml | 14 ++--- concepts/copy-file-with-rsync-concept.xml | 10 ++-- concepts/copy-file-with-rsync-locally.xml | 2 +- concepts/copy-file-with-rsync-remotely.xml | 2 +- concepts/copy-file-with-rsync-usage.xml | 5 +- ...-file-with-rsyc-configure-rsync-server.xml | 2 +- tasks/copy-file-with-rsyc-usage.xml | 58 ------------------- 7 files changed, 15 insertions(+), 78 deletions(-) delete mode 100644 tasks/copy-file-with-rsyc-usage.xml diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml index aa60c8dd5..996c748a0 100644 --- a/articles/copy-file-with-rsync.asm.xml +++ b/articles/copy-file-with-rsync.asm.xml @@ -78,7 +78,7 @@ - Copy Files using rsync command + Copy files and directories using rsync @@ -117,7 +117,7 @@ &sles; Copy files and directories using rsync command. - An overview of copying files locally and remotely using rsync. + An overview of copying files and directories locally and remotely using rsync. File copy using rsync @@ -167,13 +167,9 @@ REQUIREMENTS - - - - Access permissions to the source and destination locations for copying files. - - - + + Access permissions to the source and destination locations for copying files. + diff --git a/concepts/copy-file-with-rsync-concept.xml b/concepts/copy-file-with-rsync-concept.xml index 5944e9867..d4d4086e5 100644 --- a/concepts/copy-file-with-rsync-concept.xml +++ b/concepts/copy-file-with-rsync-concept.xml @@ -17,11 +17,11 @@ - Files stored in multiple devices or directories must be in synchronization with each other to ensure accuracy and maintainability of data. rsync is a tool used for transferring or copying files locally and remotely. rsync is unidirectional and it copies files only in one direction, it does not synchronize data. -Instead of transmitting all the contents in the file, rsync minimizes the amount of data copied by moving only the changes within the file. Hence, this supports transfer of data over slow network connection. + You can use the rsync tool for transferring or copying files locally and remotely. rsync is unidirectional and it copies files only in one direction, it does not synchronize data. +Instead of transmitting all the contents in the file, rsync minimizes the amount of data copied by moving only the changes within the file. Hence, this supports transfer of data over slow network connection. - To use rsync for large files, detecting changes requires certain computing power. So ensure that machines on both source and destination have enough resources, including RAM. -You can use rsync when large amounts of data containing only minor changes need to be transmitted regularly. Hence, this is useful when working with backups. rsync can also be useful for mirroring staging servers that store complete directory trees of Web servers to a Web server in a DMZ. -This article includes examples that shows the usage of the rsync command to copy files locally and remotely. This document also explains how to configure and use an rsync server. + For copying large files using rsync, detecting changes requires certain computing power. So ensure that machines on both source and destination have enough resources, including RAM. +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. rsync can also be useful for mirroring staging servers that store complete directory trees of Web servers to a Web server in a DMZ. +This article includes examples that shows the usage of the rsync to copy files locally and remotely. This document also explains how to configure and use an rsync server. diff --git a/concepts/copy-file-with-rsync-locally.xml b/concepts/copy-file-with-rsync-locally.xml index a1bc4228a..8f8f16429 100644 --- a/concepts/copy-file-with-rsync-locally.xml +++ b/concepts/copy-file-with-rsync-locally.xml @@ -19,7 +19,7 @@ You can copy files within the same machine using rsync if you have write permission for the destination location. - To copy file to the location /var/backup, use the following command: + To copy file backup.tar.xz to the location /var/backup, use the following command: rsync -avz backup.tar.xz /var/backup/ The file backup.tar.xz is copied to /var/backup/; the absolute path is/var/backup/backup.tar.xz. diff --git a/concepts/copy-file-with-rsync-remotely.xml b/concepts/copy-file-with-rsync-remotely.xml index 0dccee30e..019d1dd61 100644 --- a/concepts/copy-file-with-rsync-remotely.xml +++ b/concepts/copy-file-with-rsync-remotely.xml @@ -20,7 +20,7 @@ To copy a single file from one directory on your machine to /var/backup, use the following command: rsync -avz tux /var/backup/ - Ensure that you add the trailing slash after the/var/backup/ directory. If you do not insert the slash, the file backup.tar.xz is copied to /var/backup (file) not inside the directory /var/backup/. + Ensure that you add the trailing slash after the/var/backup/ directory. If you do not insert the slash, the file backup.tar.xz is copied to /var/backup file and not inside the directory /var/backup/. Verify the copied file in the absolute path /var/backup/backup.tar.xz. To copy the directory tux/ and its content into the directory /var/backup/ rsync -avz tux /var/backup/ diff --git a/concepts/copy-file-with-rsync-usage.xml b/concepts/copy-file-with-rsync-usage.xml index e56ee4486..b96228d16 100644 --- a/concepts/copy-file-with-rsync-usage.xml +++ b/concepts/copy-file-with-rsync-usage.xml @@ -16,12 +16,11 @@ Copy files with rsync - You can use rsync on any remote machine you have access and write permissions. + You can use rsync on any machine you have access and write permissions. Copy files from source location to destination location by using the following example: - Run the following command. rsync [OPTION] SOURCE [SOURCE]... DESTINATION You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. - The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. + The trailing slash after the directory denotes the content of the directory and not the directory itself. The commonly used OPTIONS are listed below: diff --git a/tasks/copy-file-with-rsyc-configure-rsync-server.xml b/tasks/copy-file-with-rsyc-configure-rsync-server.xml index 74def84c4..7c34bc723 100644 --- a/tasks/copy-file-with-rsyc-configure-rsync-server.xml +++ b/tasks/copy-file-with-rsyc-configure-rsync-server.xml @@ -92,7 +92,7 @@ in the assembly --> Start and enable the rsyncd daemon with: systemctl enable rsyncd - systemctl start rsyncd +systemctl start rsyncd Test the access to your rsync server: rsync jupiter:: diff --git a/tasks/copy-file-with-rsyc-usage.xml b/tasks/copy-file-with-rsyc-usage.xml deleted file mode 100644 index be6f6f984..000000000 --- a/tasks/copy-file-with-rsyc-usage.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - %entities; -]> - - - - - - - Using &rsync; - - - - - You can use &rsync; on any remote machine you have access and write permissions. - - - Using &rsync; - Copy files from source location to destination location by using the following example: - - Run the following command. - rsync [OPTION] SOURCE [SOURCE]... DESTINATION You can have multiple SOURCE entries and the SOURCE and DESTINATION placeholders can be paths, URLs or both. - - The trailing slash after the directory denotes the content of the directory. No trailing slash denotes the directory itself. - The commonly used OPTIONS are listed below: - - - - -V - Outputs more verbose text. - - - - -a - Archive mode; copies files recursively and preserves time stamps, user/group ownership, file permissions, and symbolic links. - - -z - Compresses the transmitted data. - -n or --dry-run - Performs a trial run with no changes made. - -r - recurse into directories - --progress - show progress during transfer - - - - \ No newline at end of file From e07812aa8de436dd4c3cddff84c1d71ea421b7eb Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Tue, 4 Jun 2024 13:14:41 +0530 Subject: [PATCH 08/14] Updated troubleshooting content. --- .../copy-file-with-rsync-troubleshooting.xml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 concepts/copy-file-with-rsync-troubleshooting.xml diff --git a/concepts/copy-file-with-rsync-troubleshooting.xml b/concepts/copy-file-with-rsync-troubleshooting.xml new file mode 100644 index 000000000..8f971feaa --- /dev/null +++ b/concepts/copy-file-with-rsync-troubleshooting.xml @@ -0,0 +1,53 @@ + + +%entities; +]> + + + + Troubleshooting rsync + + + You can use the following checklist if you are not able to perform file or folder copy using rsync. + + + +
+ + + + + Have latest version of rsync. + + + + + Have rsync access permission. + + + + + The specified hostname corresponds to the correct storage location (Example, vny, cpm, or ams). The rsync hostname assigned to your account is listed on the RSYNC page. + + + + + The command used to transfer your content matches the syntax defined below. + rsync -avp {Local Path} {User Name}@rsync.yyy.AN.{Base Domain}:{Destination Path} + + + The {Local path} points to an existing folder on your system. +Ensure that {Destination Path} starts with a forward slash. +/DestinationFolder + + + +
From 5650760df6cf96d182c254c388f589aef2660b39 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Wed, 5 Jun 2024 10:54:30 +0530 Subject: [PATCH 09/14] Updated the link. --- articles/copy-file-with-rsync.asm.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml index 996c748a0..c58b19c7d 100644 --- a/articles/copy-file-with-rsync.asm.xml +++ b/articles/copy-file-with-rsync.asm.xml @@ -45,6 +45,9 @@ Use rsync to copy files and directories. + + + The steps to follow if rsync fails to copy files or directories. @@ -196,6 +199,7 @@ + From 5af886ac034a17e676cc2e26a5e635c9f073b77a Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Wed, 5 Jun 2024 10:55:33 +0530 Subject: [PATCH 10/14] Updated --- articles/copy-file-with-rsync.asm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/copy-file-with-rsync.asm.xml b/articles/copy-file-with-rsync.asm.xml index c58b19c7d..243b09263 100644 --- a/articles/copy-file-with-rsync.asm.xml +++ b/articles/copy-file-with-rsync.asm.xml @@ -199,7 +199,7 @@ - + From 64df604f513566c5bd2929808940e88cb376e9ec Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Wed, 5 Jun 2024 12:16:05 +0530 Subject: [PATCH 11/14] Updated steps. --- .../copy-file-with-rsync-troubleshooting.xml | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/concepts/copy-file-with-rsync-troubleshooting.xml b/concepts/copy-file-with-rsync-troubleshooting.xml index 8f971feaa..ead374f72 100644 --- a/concepts/copy-file-with-rsync-troubleshooting.xml +++ b/concepts/copy-file-with-rsync-troubleshooting.xml @@ -15,39 +15,35 @@ Troubleshooting rsync - - You can use the following checklist if you are not able to perform file or folder copy using rsync. - - + + File or folder copying may fail due to several reasons. Ensure that you have the required permissions and resources to perform the file copy. -
- - + Possible troubleshooting methods are mentioned below: + - Have latest version of rsync. + Ensure that you have the latest version of rsync. - Have rsync access permission. + Ensure that you have the required rsync access permission. - The specified hostname corresponds to the correct storage location (Example, vny, cpm, or ams). The rsync hostname assigned to your account is listed on the RSYNC page. - + Ensure that the specified hostname corresponds to the correct storage location (Example, vny, cpm, or ams). The rsync hostname assigned to your account is listed on the RSYNC page. - The command used to transfer your content matches the syntax defined below. - rsync -avp {Local Path} {User Name}@rsync.yyy.AN.{Base Domain}:{Destination Path} - + Ensure that the command used to transfer your content matches the syntax defined below. + rsync -avp {Local Path} {User Name}@rsync.yyy.AN.{Base Domain}:{Destination Path} - The {Local path} points to an existing folder on your system. -Ensure that {Destination Path} starts with a forward slash. -/DestinationFolder + Ensure that the {Local path} points to an existing folder on your system. + + Ensure that {Destination Path} starts with a forward slash. +/DestinationFolder -
+ From 0f5e33eb6e9d60c0dc5426adaf90c0c2dfcd4123 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Wed, 5 Jun 2024 12:36:33 +0530 Subject: [PATCH 12/14] Added rsync options. --- concepts/copy-file-with-rsync-usage.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/concepts/copy-file-with-rsync-usage.xml b/concepts/copy-file-with-rsync-usage.xml index b96228d16..576c56d9f 100644 --- a/concepts/copy-file-with-rsync-usage.xml +++ b/concepts/copy-file-with-rsync-usage.xml @@ -26,7 +26,7 @@ -V - Outputs more verbose text. +
shows verbose output text. @@ -41,4 +41,14 @@ recurse into directories --progress show progress during transfer + -b + takes a backup during data synchronization. + -h + shows the numbers in the output in a human-readable format. + -e + for remote transfers, instruct rsync to utilize the SSH protocol. + -q or --quiet + silences the rsync command and option output. + --version + print the rsync version number and exit. From be881b6a447cb084815625de5e0fc83105668bff Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Wed, 5 Jun 2024 12:38:31 +0530 Subject: [PATCH 13/14] Updated options. --- concepts/copy-file-with-rsync-usage.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/concepts/copy-file-with-rsync-usage.xml b/concepts/copy-file-with-rsync-usage.xml index 576c56d9f..e0e863e29 100644 --- a/concepts/copy-file-with-rsync-usage.xml +++ b/concepts/copy-file-with-rsync-usage.xml @@ -40,15 +40,15 @@ -r recurse into directories --progress - show progress during transfer + shows progress during transfer -b takes a backup during data synchronization. -h shows the numbers in the output in a human-readable format. -e - for remote transfers, instruct rsync to utilize the SSH protocol. + for remote transfers, instructs rsync to utilize the SSH protocol. -q or --quiet silences the rsync command and option output. --version - print the rsync version number and exit. + prints the rsync version number and exit. From a0c336c9e7c2083c008f233bd3f5314eb3109438 Mon Sep 17 00:00:00 2001 From: Shalaka Harne Date: Mon, 5 Aug 2024 11:31:32 +0530 Subject: [PATCH 14/14] Fixed feedback from Tanja --- concepts/copy-file-with-rsync-locally.xml | 4 ++-- concepts/copy-file-with-rsync-usage.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/concepts/copy-file-with-rsync-locally.xml b/concepts/copy-file-with-rsync-locally.xml index 8f8f16429..59e054fa5 100644 --- a/concepts/copy-file-with-rsync-locally.xml +++ b/concepts/copy-file-with-rsync-locally.xml @@ -19,8 +19,8 @@ You can copy files within the same machine using rsync if you have write permission for the destination location. - To copy file backup.tar.xz to the location /var/backup, use the following command: - rsync -avz backup.tar.xz /var/backup/ + For example to copy file backup.tar.xz to the location /var/backup/, use the following command: + rsync -avz backup.tar.xz /var/backup/ The file backup.tar.xz is copied to /var/backup/; the absolute path is/var/backup/backup.tar.xz. diff --git a/concepts/copy-file-with-rsync-usage.xml b/concepts/copy-file-with-rsync-usage.xml index e0e863e29..61bf826ec 100644 --- a/concepts/copy-file-with-rsync-usage.xml +++ b/concepts/copy-file-with-rsync-usage.xml @@ -13,7 +13,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Copy files with rsync + Basic rsync usage You can use rsync on any machine you have access and write permissions.