diff --git a/web/support/kb/openstack/rclone_quick_tutorial.rst b/web/support/kb/openstack/rclone_quick_tutorial.rst index 3b83b78c5025a64beedfe8408594a315ce30a778..17559dedef2d43da94cc698d6d8278ce71a7e13e 100644 --- a/web/support/kb/openstack/rclone_quick_tutorial.rst +++ b/web/support/kb/openstack/rclone_quick_tutorial.rst @@ -1,3 +1,97 @@ Rclone quick tutorial ===================== +Installing and configuring +########################## + +If not yet installed on your machine, you can install **rclone** with the following command:: + + $ curl https://rclone.org/install.sh | sudo bash + +download rc file v3 from openstack dashboard as **openstack-credential.sh** + +.. figure:: ../../images/rc_file.png + :scale: 60% + +Then execute the content of the file:: + + $ source openstack-credential.sh + +and edit the Rclone configuration file:: + + $ nano .rclone.conf + +to look like this: + +.. code-block:: + + [garr-cloud] + type = swift + env_auth = true + +Now you can verify the functionalities with:: + + $ rclone lsd garr-cloud: + +Copy files and directories to cloud +################################### + +Make a **container** on your remote object store:: + + $ rclone mkdir garr-cloud:test-cont + +Copy a local file to the container:: + + $ rclone copy sample_file.txt garr-cloud:test-cont + $ rclone ls garr-cloud:test-cont + 1103 sample_file.txt + +Now, suppose you have these files on your local filesystem:: + + $ ls -lR /tmp/test_dir/ + /tmp/test_dir/: + total 8 + -rw-rw-r-- 1 ubuntu ubuntu 1103 Nov 13 15:31 file1.txt + drwxrwxr-x 2 ubuntu ubuntu 4096 Nov 13 15:32 subdir1 + + /tmp/test_dir/subdir1: + total 4 + -rw-rw-r-- 1 ubuntu ubuntu 459 Nov 13 15:32 file2.txt + +Execute the following command to synchronize it with the remote:: + + $ rclone sync /tmp/test_dir/ garr-cloud:test-cont/sublevel + $ rclone ls garr-cloud:test-cont + 1103 sample_file.txt + 1103 sublevel/file1.txt + 459 sublevel/subdir1/file2.txt + +**Mind behaviour of sync!** It makes destination identical to source + + +Copy files from remote to local +############################### + +The following command copies files from remote to a local directory, create it if not exists:: + + $ rclone -P copy garr-cloud:test-cont/sublevel checkDir/ + Transferred: 1.525k / 1.525 kBytes, 100%, 4.222 kBytes/s, ETA 0s + Errors: 0 + Checks: 0 / 0, - + Transferred: 2 / 2, 100% + Elapsed time: 300ms + + $ ls -lR checkDir/ + checkDir/: + total 12 + -rw-rw-r-- 1 ubuntu ubuntu 1103 Nov 13 15:31 file1.txt + -rw-rw-r-- 1 ubuntu ubuntu 1103 Nov 13 15:28 sample_file.txt + drwxrwxr-x 2 ubuntu ubuntu 4096 Nov 13 15:53 subdir1 + + checkDir/subdir1: + total 4 + -rw-rw-r-- 1 ubuntu ubuntu 459 Nov 13 15:32 file2.txt + + + + \ No newline at end of file