<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Juliano M on Medium]]></title>
        <description><![CDATA[Stories by Juliano M on Medium]]></description>
        <link>https://medium.com/@juliaaano?source=rss-11674002d733------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rwQ1dcKzFkE02ksu.jpg</url>
            <title>Stories by Juliano M on Medium</title>
            <link>https://medium.com/@juliaaano?source=rss-11674002d733------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:34:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@juliaaano/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Move Your Files Across The Cloud]]></title>
            <link>https://medium.com/@juliaaano/move-your-files-across-the-cloud-3581c18c500e?source=rss-11674002d733------2</link>
            <guid isPermaLink="false">https://medium.com/p/3581c18c500e</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[dropbox]]></category>
            <category><![CDATA[google-drive]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[Juliano M]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 10:22:30 GMT</pubDate>
            <atom:updated>2017-07-19T10:22:30.996Z</atom:updated>
            <content:encoded><![CDATA[<p>This week I decided to move files <strong>from</strong> Google Drive <strong>to</strong> a S3 bucket in AWS. Initially, I started downloading/uploading GB&#39;s worth of photos and documents from one service to another through my local machine. More specifically I used <a href="https://www.google.com/drive/download/">Google Drive</a> and <a href="https://panic.com/transmit/">Transmit</a> Mac OS clients to juggle the files around. A bad idea since it was taking forever to make progress, let alone the fact it brought my internet connection down turning it unusable for any other purpose. It was time to bring some DevOps to my own personal life…</p><p>The approach described next has to do with:</p><ul><li>Connect to an AWS EC2 instance.</li><li>Pull files from Google with <a href="https://github.com/odeke-em/drive"><em>drive</em></a><em>.</em></li><li>Upload to S3 with AWS Command Line Interface.</li></ul><h4>EC2</h4><p>This is the key part. Leverage AWS&#39;s high internet speed and storage by working in a remote computer in the cloud. There are plenty of resources out there about EC2, so I&#39;ll assume you are able to spin up and connect to a remote instance. If not, you could do everything from your machine, but that defeats the whole purpose…</p><h4>Drive</h4><p>I&#39;ve spent some time until I could find a good command line client for Google Drive. The winner by far was <a href="https://github.com/odeke-em/drive"><strong>odeke-em/drive</strong></a>. It&#39;s more reliable and it has more features than, for instance, <a href="https://github.com/prasmussen/gdrive">gdrive</a> or <a href="https://github.com/Grive/grive">grive</a>.</p><p>Before you can use <em>drive</em>, you’ll need to mount your Google Drive directory on your local file system:</p><pre>$ drive init ~/drive</pre><p>Follow the instructions and you&#39;ll notice a new folder named drive was created. Once you are in this folder, <em>drive</em> understands you are in the root of your Google Drive system, which means you can download everything by just:</p><pre>$ cd ~/drive<br>$ nohup drive pull . &amp;&gt; pull.log &amp;<br>$ tail -f pull.log # check your progress</pre><p>So how do I now I&#39;ve got all files right and I haven&#39;t missed anything? Here it comes one of the nicest features from <em>drive cli</em>:</p><pre>$ nohup drive diff . &amp;&gt; diff.log &amp;</pre><p>Check your diff.log and if it&#39;s clean, it means you have an exact copy of your files on disk.</p><h4>S3</h4><p>It&#39;s time to upload those files to S3. Since we are doing our work from an EC2 instance, inside Amazon&#39;s domain, the data transfer should be incredible fast. Have the <a href="https://aws.amazon.com/cli/">AWS CLI</a> setup and then:</p><pre>$ aws s3 cp . s3://my.bucket/ --recursive</pre><p>A similar question arises: how do I make sure I got all files up there in my bucket? Well, there isn&#39;t a canonical way to achieve that, but I find doing a <em>dryrun</em> or a file count useful for this case:</p><pre>$ aws s3 sync . s3://my.bucket/ --dryrun<br>$ aws s3api list-objects --bucket files.juliaaano \<br>--output json --query &quot;[length(Contents[])]&quot;</pre><h4>Bonus (Dropbox)</h4><p>There is an official headless client for Dropbox very easy to use. In case you need to get files from or to your dropbox account, take a look at the following resources:</p><ul><li><a href="https://www.dropbox.com/install-linux">https://www.dropbox.com/install-linux</a></li><li><a href="https://www.dropbox.com/help/desktop-web/linux-commands">https://www.dropbox.com/help/desktop-web/linux-commands</a></li></ul><h4>Why do I care?</h4><p>With all my data in S3 I&#39;m paying less for storage, I have more tools available to operate and I can setup lifecycle policies that will, for example, move files to Glacier where the cost is almost free.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3581c18c500e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>