Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to access Amazon Cloud Drive from the command line on Linux  (Read 3035 times)

0 Members and 1 Guest are viewing this topic.

akhilt

  • Guest
How to access Amazon Cloud Drive from the command line on Linux

Amazon Cloud Drive (ACD) is one such benefit of Amazon Prime. ACD is a cloud storage service similar to Dropbox, Google Drive, and the likes, but unlike others, ACD is free only for Amazon Prime members. If you are not an Amazon Prime member, you will have to pay a yearly subscription fee (11.99USD/year).

For what it's worth, I think ACD still has a long way to go to qualify as a competitive "non-free" cloud storage. Not only is there no official Linux client, but also existing official desktop/mobile clients (for Windows, OS X, Android, and iOS) are not yet up to par in terms of UI, reliability and sync capability. In the end, I found a much better "unofficial" ACD client called acd_cli, which I am going to introduce today.

acd_cli is a lightweight command-line client for Amazon Cloud Drive, allowing you to access ACD storage from the command line on Linux. It also comes with a FUSE module for ACD, so that you can "mount" ACD and accesses it as if it were part of the local file system.

In the rest of the tutorial, I will describe how to access Amazon Cloud Drive from the command line using acd_cli. It's still in beta, so be generous with any hiccups.

Install acd_cli on Linux

Requirements

acd_cli requires Python 3.3.2 or higher. So make sure that you have python3, and that its version meets this requirement.

Code: [Select]
$ python3 -V Most recent Linux distributions should meet this requirement (e.g., Python 3.3.2 on Fedora 20, Python 3.4.0 on Ubuntu 14.04, Python 3.4.2 on Debian 8).

Also, you need to have pip3 installed (check the instruction if it is not installed).

For CentOS/RHEL systems which do not have python3/pip3 in their base repositories, you can install the latest python3/pip3 following this guide.

Install acd_cli with pip

Once you have python3 and pip3 on your system, installation of acd_cli is as easy as running:
Code: [Select]
$ sudo pip3 install --upgrade --pre acdcli For Arch Linux users, there is a pre-built package from AUR.

Configure acd_cli for the First Time

Before using acd_cli, you need to go through one-time authentication, where you authorize acd_cli to access your Amazon Cloud Drive account via OAuth. To start the procedure, simply run:
Code: [Select]
$ acd_cli init
On a desktop, this will open up a new browser window, which then loads https://tensile-runway-92512.appspot.com. If you are on a headless server, you can open up a browser on a separate computer, and go to https://tensile-runway-92512.appspot.com. This web app handles the server part of the OAuth procedure, and its source code is available at https://tensile-runway-92512.appspot.com/src.

You will then be asked to sign in to your Amazon account.

Type in your Amazon.com login credential, and you will be presented with a page where you authorize acd_cli to access your ACD.

This will generate necessary OAuth credentials, which will be saved as a JSON file named "oauth_data". Place this file in ~/.cache/acd_cli folder on the host where you ran acd_cli command, and press ENTER.

Before running any command with acd_cli, you need to sync its local cache with your Amazon Cloud Drive account. Most acd_cli commands require the node cache to be up-to-date. The following is the acd_cli sync command.
Code: [Select]
$ acd_cli sync This completes the one-time setup of acd_cli. At this point, you should be able to access ACD from the command line.

Access Amazon Cloud Drive from the Command Line

Check whether acd_cli is configured correctly by running a few commands.
Code: [Select]
$ acd_cli usage
$ acd_cli ls /
The first command will show you the current usage of your ACD account (e.g., how much storage is being used). The second command shows the content of its root folder.

Here are other basic examples of acd_cli's command-line interface.

To browse a particular folder:
Code: [Select]
$ acd_cli ls /Pictures To download an entire folder locally:
Code: [Select]
$ acd_cli dl /Pictures/Family-Photos To upload an entire local folder to ACD:
Code: [Select]
$ acd_cli ul ./Akhil_Photos /Pictures
Conclusion

In this tutorial, I went over a nice little command-line tool for Amazon Cloud Drive. Despite its unofficial status, acd_cli does a wonderful job to make ACD readily accessible on Linux, even in extremely user-friendly ways.