<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Jiang</title>
    <description>The latest articles on DEV Community by David Jiang (@iceandele).</description>
    <link>https://dev.to/iceandele</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F623672%2Fe8c5ff63-e9af-4d7b-b50b-e2551c4d2ae1.jpeg</url>
      <title>DEV Community: David Jiang</title>
      <link>https://dev.to/iceandele</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iceandele"/>
    <language>en</language>
    <item>
      <title>Setting up rclone mount in Windows with GSuite Drive </title>
      <dc:creator>David Jiang</dc:creator>
      <pubDate>Sat, 01 May 2021 19:25:57 +0000</pubDate>
      <link>https://dev.to/iceandele/setting-up-rclone-mount-in-windows-with-gsuite-drive-54h4</link>
      <guid>https://dev.to/iceandele/setting-up-rclone-mount-in-windows-with-gsuite-drive-54h4</guid>
      <description>&lt;h3&gt;
  
  
  1. Download and Install Prerequisites
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Download &lt;a href="https://rclone.org/downloads/"&gt;rclone&lt;/a&gt; and &lt;a href="https://nssm.cc/download"&gt;NSSM&lt;/a&gt; in to &lt;code&gt;C:\rclone&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Download and install &lt;a href="https://github.com/billziss-gh/winfsp/releases"&gt;WinFsp&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2. Set Up your Personal Google Drive Client ID
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt; Log into the  &lt;a href="https://console.developers.google.com/"&gt;Google API Console&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; Select a project or create a new project.&lt;/li&gt;
&lt;li&gt; Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the "Google Drive API".&lt;/li&gt;
&lt;li&gt; Click "Credentials" in the left-side panel&lt;/li&gt;
&lt;li&gt; Click on the "+ CREATE CREDENTIALS" button at the top of the screen, then select "OAuth client ID".&lt;/li&gt;
&lt;li&gt; Choose an application type of "Desktop app"&lt;/li&gt;
&lt;li&gt; Keep client ID and client secret for the next step&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  3. Configure rclone
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;code&gt;C:\rclone&lt;/code&gt; and run &lt;code&gt;.\rclone.exe config&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;n/r/c/s/q&amp;gt;&lt;/code&gt; &lt;strong&gt;n&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;name&amp;gt;&lt;/code&gt; &lt;strong&gt;gdrive&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Storage&amp;gt;&lt;/code&gt; &lt;strong&gt;drive&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;client_id&amp;gt;&lt;/code&gt; &lt;strong&gt;Enter Client ID from #2.7&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;client_secret&amp;gt;&lt;/code&gt; &lt;strong&gt;Enter Client Secret from #2.7&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;scope&amp;gt;&lt;/code&gt; &lt;strong&gt;1&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;root_folder_id&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;service_account_file&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;y/n&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;y/n&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;y/n&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;y/e/d&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;e/n/d/r/c/s/q&amp;gt;&lt;/code&gt;&lt;strong&gt;q&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;mv ~\.config\rclone\rclone.conf .&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4. Configure NSSM to run rclone mount on start up
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open PowerShell as Administrator&lt;/li&gt;
&lt;li&gt;Navigate to &lt;code&gt;C:\rclone&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.\nssm.exe install rclone&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;rclone.exe&lt;/code&gt; for Application &amp;gt; Path&lt;/li&gt;
&lt;li&gt;Enter the following for Appplication &amp;gt; Arguments
&lt;code&gt;mount --vfs-cache-mode writes --log-level INFO --config "C:\rclone\rclone.conf" --log-file "C:\rclone\rclone.log" gdrive: G:&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Start the service &lt;code&gt;.\nssm.exe start rclone&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  5. Backing up local files to GDrive
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;To copy local directory to remote
&lt;code&gt;.\rclone.exe copy 'B:\Photos\' gdrive:Photos -v&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;To sync local directory to remote
&lt;code&gt;.\rclone.exe sync 'B:\Photos\' gdrive:Photos -v&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Compare Local and remote
&lt;code&gt;.\rclone.exe check 'B:\Photos\' gdrive:Photos&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>homelab</category>
    </item>
  </channel>
</rss>
