Making the most of Ubuntu's personal cloud service

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Clientless One

Sometimes, you find yourself wanting to get at your files onto Ubuntu One without having the Ubuntu One client around. Obviously, the U1 website works fine for this if you want to download or upload just a few files, but if you have lots, then using the website can be quite tedious.

Installing the Ubuntu One client is the best way to send files up and down the line, but perhaps you don't want to do that this time. Maybe you're on a headless server, or you don't want to sync down all your Ubuntu One content to this machine.

Luckily, you have an alternative: u1ftp [4]. This tool runs as a little program on your machine and acts as an FTP server that talks to Ubuntu One under the covers.

This means that you can use any FTP client to connect to it and see all your Ubuntu One storage. Uploading or downloading lots of files can then be done in the same way that you might use FTP to upload or download files from any server, such as a website server. Download u1ftp [5] and run it with python u1ftp-0.1.zip. Then, use your FTP client of choice to connect to http://localhost:2121. This works anywhere that you have Python, whether it's a Linux desktop machine, Windows, OS X, or headless Ubuntu server. See Listing 1 for an example of u1ftp in action.

Listing 1

Accessing Ubuntu One with u1ftp

01 <In one terminal...>
02 $ wget -q https://launchpad.net/u1ftp/trunk/0.1/+download/u1ftp-0.1.zip
03 $ ls
04 u1ftp-0.1.zip
05 $ python u1ftp-0.1.zip&
06 Listening on ftp://127.0.0.1:2121/
07 $ ftp localhost 2121
08 Connected to localhost.
09 220 Twisted 11.1.0 FTP Server
10 Name (localhost:aquarius): your Ubuntu One email
11 331 Password required for your Ubuntu One email.
12 Password:
13 230 User logged in, proceed
14 Remote system type is UNIX.
15 Using binary mode to transfer files.
16 ftp> ls
17 200 PORT OK
18 125 Data connection already open, starting transfer
19 drwxr-xr-x   1 user      group                   0 Jan 01  1970 Documents
20 drwxr-xr-x   1 user      group                   0 Jan 01  1970 Ubuntu One
21 drwxr-xr-x   1 user      group                   0 Jan 01  1970 Work

Hacker Friendly

If you're into getting your hands dirty, Ubuntu One is also fully available to programmers. All of its capabilities are available through its APIs, meaning that you can build Ubuntu One into apps you write or write shell scripts or small programs to do interesting things that the Ubuntu One team hasn't thought of.

For example, you might want to make not just a file but a whole folder available for people to view. Sharing a file gets you a link to it, as above, but you can't do that with a folder. However, a little Python work with the Ubuntu One API, and you can sort that out. For example, check out the script I created [6]. To use it, you can simply type python u1-publish-folder path/to/some/folder in a terminal window. You can see sample run of the u1-publish-folder process in Listing 2.

Listing 2

Sharing a Whole Folder with the U1 API

01 $ python u1-publish-folder "Ubuntu One/Published Folder/"
02 Examining folder /home/me/Ubuntu One/Published Folder
03 Publishing 3 files...
04   published /home/me/Ubuntu One/Published Folder/site-text.txt
05   published /home/me/Ubuntu One/Published Folder/website-screenshot.png
06   published /home/me/Ubuntu One/Published Folder/How fast.ogg
07 Constructing the folder index...
08 Waiting for Ubuntu One to upload index...
09 Done.
10 Publishing the folder index...
11 Folder index now available at http://ubuntuone.com/7FzTucUIxKbfLvADU2JTCC

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content