Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cloud
web
Commits
ae3d5087
Commit
ae3d5087
authored
5 years ago
by
Delia Passalacqua
Browse files
Options
Downloads
Patches
Plain Diff
Update rclone_quick_tutorial.rst
parent
674c2472
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/support/kb/openstack/rclone_quick_tutorial.rst
+94
-0
94 additions, 0 deletions
web/support/kb/openstack/rclone_quick_tutorial.rst
with
94 additions
and
0 deletions
web/support/kb/openstack/rclone_quick_tutorial.rst
+
94
−
0
View file @
ae3d5087
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment