Skip to content
Snippets Groups Projects
Commit ae3d5087 authored by Delia Passalacqua's avatar Delia Passalacqua
Browse files

Update rclone_quick_tutorial.rst

parent 674c2472
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment