FullBackup to Amazon drive

Amazon is offering UNLIMITED storage for only $59USD/year (with 3 months free trial).

For me – amazing thing for backups!

Unfortunately there’s only client for Windows/Mac  which is pretty dumb…. It can just Upload/Download files. For manual backups from Win OK. But I wanted to do something that can do backups from my Linux machines.

 

Pretty nice tool that I’m using is acdcli.
It’s full documentation you can find at ReadTheDoc. So there’s no need to do full list of all features and howtos here…. I’m going to go through install and basic usage for working with the Amazon Drive.

INSTALL

Let’s start with requirements. The easiest way is through pip, and for pip we need python.

Quick hint (not sure if bug or feature of Ubuntu). I was receiving error:

The fix is easy – upgrade pip, but not through apt or the command that is recomended… But like that:

To do the initial “init” procedure we  also need web browser to save the oauth file. I like w3m, but it really depends on your taste.

And finally install the acdcli with pip. I used the instalation from the git (this is great to obtain the latest version. Also we use this for upgrading 😉 )

Then we can create the initial init procedure (if you don’t have amazon account yet it’s better to start creating it from your workstation browser)

* Log in your Amazon account


* You receave the oauth_data
* save with <Shift><S> to /root/.cache/acd_cli/oauth_data
* little trick – it’s a bit crippled… so with ! you can exec shell and edit /root/.cache/acd_cli/oauth_data so it will contain something like:

{
“access_token”: “Atza|IwEBIMso……”,
“expires_in”: 3600,
“refresh_token”: “Atzr|IwEBIDeU……”,
“token_type”: “bearer”
}

And we can do the first sync

From this moment we can use all acdcli features

Next step is to create a directory where we want to save our data (this can be done with the web GUI. But really important is to do the sync to have the latest structure available.

And the last step is to finally backup what we want, where we want……
Thanks to Linux amazing feature to pipe one output to another one – we can make all needed in one step (tar/GPG/save)

tar what I want (in this case /etc )
-> GPG (configured to be possible to run from batch, taking password from file
-> saving directly to amazon

The reason why I use GPG in the middle is to have the feeling of encrypted data (and in case I lost the account, Amazon decided to sniff around etc. the stealing of this will be a bit more difficult)

And the final script that is run by cron is:

 

this it the first version… maybe I’ll put some more notes later 😉

Leave a Comment

Your email address will not be published. Required fields are marked *