Using a Raspberry Pi With The Cloud Storage Service From Copy

Barracuda Networks is known for its network products, including Spam, Virus and Firewall appliances. In February 2013, the company launched its cloud storage service, Copy.com, with several unique features including 256-bit AES encryption and support for multiple platforms such as Linux, Windows, Mac, and even the Raspberry Pi.

Having a cloud storage service that caters to Linux users is great (especially with the upcoming closure of Ubuntu One), but having one that works also on the Raspberry Pi is fantastic!

The first step is to download the Copy.com client for Raspberry Pi using wget:

The “wget” command should already be installed on your Pi, but if it isn’t you can install it using:

You will now have a file called “Copy.tgz” in your home directory. You can unpack the file using:

This will create a folder called “copy,” and in it there will be three sub-folders: “armv6h,” “x86,” and “x86_64.” The first one contains the Copy client binaries for the Raspberry Pi, the second contains the Copy client for 32-bit Linux on a PC, and the third the same client but for 64-bit Linux PCs.

We will use the Raspberry Pi binaries; however, using the Copy.com client is essentially the same on Linux PCs. There are two tools provided by Barracuda Networks: “CopyCmd” and “CopyConsole.” The first is a general utility which allows you to perform certain specific actions like retrieving a file or getting the public link for a file. The second is the command line version of the Copy app which syncs a local folder with the cloud storage.

The CopyCmd tool can be quite complex, but simple operations are easy to perform. Here is how you get a list of the files stored at Copy.com:

The command needs to be run from the “armv6h” directory. If you want to run the command from somewhere else, you should provide the full path to the CopyCmd binary. The “username” and “password” are self explanatory. The last parameter “ls” tells the tool to list the files in the cloud. Use “ls -r” to get a recursive listing.

To download a file from Copy.com use:

The reason why “report1.doc” is repeated is that the first instance is the name of the file on Copy.com, and the second is the local file name. In both cases, full path names can be used, e.g. the second half of the command would be: “get 'Reports/report1.doc' '/home/pi/reports1.doc'

To see a list of the other commands supported by CopyCmd, just run the binary without any parameters to see the built-in help information.

The CopyConsole tool keeps a folder on your Raspberry Pi synchronized with the data on Copy.com. Whatever is uploaded to Copy.com from any client or via the web will be downloaded onto the Pi. Likewise any files added to the designated directory on the Pi will be uploaded to Copy.com.

The sync app runs in the background and is started like this:

The “-root” parameter specifies which directory on the Pi will be synchronized with the online storage. If you don’t specify the password then the program will prompt you for one.

copy.com-CopyConsole-rpi

One thing worth noting is that if you have lots of files stored on Copy.com, and you activate the sync agent, then all of the data you have stored on the service will be downloaded to your Pi. Since many users probably use their Raspberry Pi with a 4GB or 8GB SD card, there is the danger of the storage filling up quickly.

You can also run the program in the foreground by omitting the “-daemon” parameter.

If you are using the Copy.com client on a Linux PC (with an Intel or compatible processor), then there is also a third program called CopyAgent. It is a graphical program that runs on the Linux desktop. To run the client, find the “x86” or “x86_64” subfolder and double click on “CopyAgent.” It is similar to the Copy.com client that is found on Windows and OS X. The initial setup requires you to enter your Copy.com credentials and then confirm the sync folder. Once configured, the client remains in the tray and synchronizes the folders in the background.

copy.com-client-on-linux

Have you tried Copy.com and do you use the Raspberry Pi or Linux client program? Please let us know your experiences with the service in the comments below.

4 comments

  1. I got myself a pi, primarily to run copy-syncing on it. As long as the root folder is on the SD card, no problem (haven’t synced large collections though). But if I move the copy-console’s root folder to a mounted NFS-share or even a USB flashdrive (I tried FAT32 and EXT4), it fails. Well, it pretends to be running, but nothing is actually syncing and in the trace I see it looses the root folder.

    I run copy-console as pi and as pi I can write to said directories. Any hints are welcomed.

  2. I would recommend using git-annex instead. It got a web interface and can syncronize files between different accounts on many different machines and backup on cloud storages.

  3. Thanks for this — it’s exactly what I was looking for in a pi I’m using on a remote weather station.

    I’m having trouble getting the daemon to work, through. Working over Putty e.g.
    this works:
    ./CopyConsole -u=gary@example.com -p=’mypass’ -root=/home/pi/Copy

    but this:
    ./CopyConsole -daemon -u=gary@example.com -p=’mypass’ -root=/home/pi/Copy
    returns ” Forking to daemon process” which looks like success, but the service is not synching for me.

    What am I missing?

    • seem like just running the command wont work, you will need to create an init script to execute it for you

Comments are closed.

Sponsored Stories