{"id":2248,"date":"2015-02-12T09:23:05","date_gmt":"2015-02-12T09:23:05","guid":{"rendered":"http:\/\/linoxide.com\/how-tos\/configure-rclone-linux-sync-cloud\/"},"modified":"2026-01-30T06:19:27","modified_gmt":"2026-01-30T06:19:27","slug":"configure-rclone-linux-sync-cloud","status":"publish","type":"post","link":"https:\/\/linoxide.com\/configure-rclone-linux-sync-cloud\/","title":{"rendered":"Rclone &#8211; Sync File and Directories to Cloud Storage in Linux"},"content":{"rendered":"\n<p>Hi all, today we\u2019ll learn what is Rclone and how to install it in our Linux Based Operating System.<\/p>\n\n\n\n<p><strong>Rclone<\/strong>&nbsp;is a command line program to sync files and directories to and from&nbsp;Google Drive,&nbsp;Amazon S3,&nbsp;Openstack Swift \/ Rackspace cloud files \/ Memset Memstore,&nbsp;Dropbox,&nbsp;Google Cloud Storage,&nbsp;The local filesystem. It is&nbsp;a Go program and comes as a single binary file. Rclone is a Free and Open Source Software under the terms of MIT license which is hosted in its Github Repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Some Salient Features of Rclone are:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>MD5SUMs checked at all times for file integrity<\/li>\n\n\n\n<li>Timestamps preserved on files<\/li>\n\n\n\n<li>Partial syncs supported on a whole file basis<\/li>\n\n\n\n<li>Copy mode to just copy new\/changed files<\/li>\n\n\n\n<li>Sync mode to make a directory identical<\/li>\n\n\n\n<li>Check mode to check all MD5SUMs<\/li>\n\n\n\n<li>Can sync to and from network, eg. two different Drive accounts<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p>Rclone is a Go program and comes as a single binary file. We can&nbsp;Download the relevant binary from their official site.<\/p>\n\n\n\n<p>Or install it via Go program. If you don\u2019t have Go Program, you can install it as shown below:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Installing Go<\/h4>\n\n\n\n<p>On a Ubuntu system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install golang<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2026\/01\/installing-golang.png\" alt=\"Installing golang\" class=\"wp-image-9362\"\/><\/figure>\n\n\n\n<p>On Fedora, CentOS, RHEL system:<\/p>\n\n\n\n<p>a)&nbsp;Download and setup Fedora EPEL Repository<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum install http:\/\/ftp.riken.jp\/Linux\/fedora\/epel\/6\/i386\/epel-release-6-8.noarch.rpm<\/code><\/pre>\n\n\n\n<p>b) Installing golang using&nbsp;<strong>yum<\/strong>&nbsp;manager<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum install golang<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. Installing Rclone with&nbsp;Go<\/h4>\n\n\n\n<p>We can install rclone with Go program easily with just a single command firing which will build the binary&nbsp;in&nbsp;<code>$GOPATH\/bin&nbsp;<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ go get github.com\/ncw\/rclone<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: If you get any error like&nbsp;<strong>package github.com\/ncw\/rclone: cannot download, $GOPA<\/strong><strong>TH not set. For more details see: go help gopath<\/strong>&nbsp;then, it is clear that we haven\u2019t defined $GOPATH.<\/p>\n\n\n\n<p>It is the directory where our Go program downloads and builds packages. To fix this we should execute the following command in a shell or terminal and then retry&nbsp;above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ export GOPATH=\"$HOME\/gopath\/\"<\/code><\/pre>\n\n\n\n<p>Here, the above command will point<strong>&nbsp;$GOPATH to \/home\/username\/gopath\/<\/strong>&nbsp;directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring<\/h2>\n\n\n\n<p>Now, as we have successfully installed our rclone under our \/home\/username\/gopath\/&nbsp;directory. We\u2019ll now want to configure our rclone. So, to do that, we\u2019ll need to enter into the $GOPATH\/bin as the binary rclone is inside that folder.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cd $GOPATH\/bin<\/code><\/pre>\n\n\n\n<p>Now, as we are inside the bin directory where an executable file named rclone is situated. We\u2019ll want to make rclone binary easily accessible as global binary command. To do so, we\u2019ll copy file<strong>&nbsp;<\/strong><strong>rclone<\/strong>&nbsp;to \/usr\/bin\/ as root mode.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo cp rclone \/usr\/bin\/<\/code><\/pre>\n\n\n\n<p>Now, we\u2019ll want to configure it as.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone config<\/code><\/pre>\n\n\n\n<p>Now, we\u2019ll get option to create a new remote. As we have no remote currently, we\u2019ll surely wanna add it.<br>To&nbsp;<strong>add a new remote<\/strong>, we\u2019ll need to&nbsp;<strong>enter n<\/strong>, and&nbsp;<strong>give some name to it, we\u2019ve named it as gdrive<\/strong>. After that, we\u2019ll be listed a set of&nbsp;source that we want to use with our new&nbsp;<strong>remote<\/strong>. As we\u2019re going for testing&nbsp;<strong>Google Drive<\/strong>, we\u2019ll wanna choose<strong>&nbsp;6)&nbsp;drive.<\/strong><\/p>\n\n\n\n<p>Then, we\u2019ll be asked some questions on using the client we can just press enter and use the rclone\u2019s app by default.&nbsp;Then, we\u2019ll be given a link which we should accept inorder to connect rclone with Google Drive. We should browse that link in a web browser, then we\u2019ll be given a&nbsp;code which we\u2019ll need to paste into our rclone\u2019s Command Line Interface.<\/p>\n\n\n\n<p>Now, we\u2019ll wanna enter&nbsp;<strong>Y<\/strong>&nbsp;to confirm the configuration and we wanna&nbsp;<strong>quit rclone config<\/strong>&nbsp;now. Now,&nbsp;we have successfully connected Rclone with Google Drive.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Rclone<\/h2>\n\n\n\n<p>Now, we\u2019ll learn how to use Rclone to transfer\/sync files and folders with Google Drive. &nbsp;Here are some usages that we can perform with Rclone tool.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Copy<\/h4>\n\n\n\n<p>To copy a file or folder, we can execute&nbsp;<strong>rclone copy source:path dest:path<\/strong>&nbsp;command as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone copy&nbsp;\/home\/arun\/Documents\/linoxide\/ gdrive:linoxide<\/code><\/pre>\n\n\n\n<p>Here, we\u2019ll copy folder named&nbsp;<strong>linoxide<\/strong>&nbsp;which is inside&nbsp;<strong>\/home\/arun\/Documents\/<\/strong>&nbsp;to the remote server\u2019s folder named&nbsp;<strong>linoxide<\/strong>&nbsp;.<\/p>\n\n\n\n<p>Similarly to copy a single file we can point the source:path to file to copy a file to the destination.<\/p>\n\n\n\n<p><strong>Note:&nbsp;It doesn\u2019t delete files from the destination.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Sync<\/h4>\n\n\n\n<p>We can easily synchronize the source to the destination using the command&nbsp;<strong>rclone sync source:path dest:path<\/strong>&nbsp;as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone sync&nbsp;\/home\/arun\/Documents\/linoxide\/&nbsp;gdrive:linoxide<\/code><\/pre>\n\n\n\n<p>Here, the directory&nbsp;<strong>\/home\/arun\/Documents\/linoxide\/<\/strong>&nbsp;is synchronized to a remote directory called linoxide.<\/p>\n\n\n\n<p><strong>Note: It deletes any files that exist in source that don\u2019t exist in destination. Since this can cause data loss, test first with the -dry-run flag.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Listing<\/h4>\n\n\n\n<p>We can view the list of files, folders of our remote server which we are connected. Here, as we have added and connected with our Google Drive as remote name gdrive. We\u2019ll enter the following commands to view them.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone ls gdrive:<\/code><\/pre>\n\n\n\n<p>Lists all the objects in the the path with sizes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone lsl gdrive:<\/code><\/pre>\n\n\n\n<p>Lists all the objects in the path with sizes and timestamps.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone lsd gdrive:<\/code><\/pre>\n\n\n\n<p>Lists all directories\/objects\/buckets in the the path.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Creating and Removing Paths<\/h4>\n\n\n\n<p>Creating a new directory to the remote server gets easy with rclone mkdir . We can simply enter the following command in order to create a directory inside our remote. Here, we have created a folder named arun inside linoxide which&nbsp;doesn\u2019t already exist before.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone mkdir&nbsp;gdrive:\/linoxide\/arun<\/code><\/pre>\n\n\n\n<p>We can remove an empty directory with rmdir command. Here, we are gonna delete the newly created folder arun which is under linoxide parent directory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone rmdir&nbsp;gdrive:\/linoxide\/arun<\/code><\/pre>\n\n\n\n<p>Now, if we wanna delete a non-empty directory and its contents then, we\u2019ll use&nbsp;<strong>purge<\/strong>&nbsp;for that. Here, we\u2019ve a directory data which contains many files and folders inside.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone purge&nbsp;gdrive:\/linoxide\/data<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verifying the paths<\/h4>\n\n\n\n<p>Now, to check and match&nbsp;the files in the source and destination we\u2019ll use&nbsp;<strong>check<\/strong>&nbsp;command. It compares sizes and MD5SUMs and prints a report of files which don\u2019t match.<strong>&nbsp;It doesn\u2019t alter the source or destination.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone check \/home\/arun\/linoxide\/linux.tar &nbsp;gdrive:\/linoxide\/linux.tar<\/code><\/pre>\n\n\n\n<p>If we wanna produce an md5sum file for all the objects in the path we can run md5sum command with rclone pointing to the remote directories. This is in the same format as the standard md5sum tool produces.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ rclone md5sum&nbsp;gdrive:\/linoxide\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Hurray we have successfully installed Rclone and learned how to use it. So as we know, this article tutors us about what is Rclone, its features, procedure&nbsp;to install and use it.&nbsp;Rclone is a command line program to sync files and directories to and from&nbsp;Google Drive,&nbsp;Amazon S3,&nbsp;Openstack Swift \/ Rackspace cloud files \/ Memset Memstore,&nbsp;Dropbox,&nbsp;Google Cloud Storage,&nbsp;The local filesystem.&nbsp;If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy Rclone<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all, today we\u2019ll learn what is Rclone and how to install it in our Linux Based Operating System. Rclone&nbsp;is a command line program to sync files and directories to and from&nbsp;Google Drive,&nbsp;Amazon S3,&nbsp;Openstack Swift \/ Rackspace cloud files \/ Memset Memstore,&nbsp;Dropbox,&nbsp;Google Cloud Storage,&nbsp;The local filesystem. It is&nbsp;a Go program and comes as a single binary file. Rclone is a Free and Open Source Software under the terms of MIT license which is hosted in its Github Repository. Some Salient Features of Rclone are: Installation Rclone is a Go program and comes as a single binary file. We can&nbsp;Download the<\/p>\n","protected":false},"author":1,"featured_media":2247,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[26],"tags":[],"class_list":["post-2248","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/posts\/2248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/comments?post=2248"}],"version-history":[{"count":1,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/posts\/2248\/revisions"}],"predecessor-version":[{"id":2286,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/posts\/2248\/revisions\/2286"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/media\/2247"}],"wp:attachment":[{"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/media?parent=2248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/categories?post=2248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linoxide.com\/wp-json\/wp\/v2\/tags?post=2248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}