In today's online retail market dominated by cut throat competitions, one player stands in the forefront, leaving the pack far behind, and that is Amazon. Amazon has been judiciously expanding its business model to satisfy consumer appetites, and I think Amazon Prime membership lies in the center of its expanding business model. Starting out as unlimited free-shipping membership, Amazon Prime has grown over time to include a variety of other perks, including unlimited streaming music, movies and TV dramas, unlimited photo gallery, free e-book library, and now same-day/one-day delivery.
Granted 99USD/year price tag for Prime membership is still hefty for non-regular Amazon customers, but people like me who purchase virtually everything from Amazon and enjoy its other perks everyday, Prime membership is worth every penny.
What is Amazon Cloud Drive?
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 or don't plan to become one, this post is not for you (unless of course you are willing to pay for ACD).
For those Amazon Prime members, Amazon Cloud Drive is where you can store "unlimited" amount of photos and upto 5GB of other files for free. Some Prime customers (like me) may be offered a free upgrade to "Unlimited Everything" plan in which you get unlimited space for any files. If you are not a 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 access it as if it were part of local file system. Pretty neat!
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
acd_cli requires Python 3.3.2 or higher. So make sure that you have python3, and that its version meets this requirement.
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:
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:
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.
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
Let's quickly check whether acd_cli is configured correctly by running a few commands.
$ 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:
To download an entire folder locally:
To upload an entire local folder to ACD:
Check the official documentation for the complete list of available actions.
Mount Amazon Cloud Drive on Linux
Another useful feature of acd_cli is its FUSE support, allowing unprivileged users to mount Amazon Cloud Drive as a FUSE filesystem.
To mount ACD locally, simply run:
Now you can use native Linux commands (e.g., ls, df, cp, mv) to access your ACD account.
To unmount ACD:
If you want to have your ACD account mounted automatically on boot, you can configure systemd to auto-mount ACD (assuming that you are using systemd on your Linux).
The following is how to set up a systemd user instance for ACD service.
First create necessary folders (i.e., local mount point and systemd's user folder).
$ mkdir -p ~/.config/systemd/user
Create the following systemd file.
[Unit] Description=user Amazon Cloud Drive FUSE mount Documentation=https://acd-cli.readthedocs.org/en/latest/ AssertPathIsDirectory=%h/acd After=network-online.target [Service] Type=simple ExecStart=/usr/local/bin/acd_cli mount --foreground %h/acd ExecStop=/usr/local/bin/acd_cli -v -nl umount %h/acd Restart=on-abort [Install] WantedBy=default.target
Finally reload and enable systemd as a "regular" user:
$ systemctl --user start amazon-cloud-drive.service
$ systemctl --user enable amazon-cloud-drive.service
Now your ACD account should be mounted at ~/acd automatically upon boot.
Note that the FUSE support of acd_cli is labeled as "experimental." So treat this feature as such.
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. Something folks at Amazon should learn from. Kudos to the developer!
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!