ClientControl

Revision 3 as of 2010-05-19 17:38:20

Clear message

Controlling Ubuntu One Client

First of all, applet is no longer present in Ubuntu One installation. It was necessary until the system components become decoupled enough and therefore the plan to remove it existed from the beginning.

Additionally the applet started to be abused to report the bug reports for all other ubuntu components.

The applet was the service that provided the notifications, notifications are no longer displayed to the user.

Ubuntu One Client Components:

  • ubuntuone-login
  • ubuntuone-syncdaemon
  • ubuntuone-preferences
  • u1sdtool

You will not interact with ubuntuone-login directly, this is a service that is used for ubuntuone OAuth login. ubuntuone-syncdaemon or SD for short is the main component of the file sync service. This application is watching the file changes and uploads/downloads the files when needed. ubuntuone-preferences is the GUI tool to control various aspects of Ubuntu One service. Currently it can show your user info, quota usage and control syncdaemon connectivity.

u1sdtool is a command line application that was not that much used earlier. Currently it supports everything you need to control your syncdaemon:

Usage: u1sdtool [option]

Options:
  -h, --help            show this help message and exit
  -w, --wait            Wait until ubuntuone-syncdaemon reaches nirvana
  --accept-share=SHARE_ID
                        Accept the share with the specified id
  --reject-share=SHARE_ID
                        Reject the share with the specified id
  --list-shares         Get the list of shares
  --refresh-shares      Request a refresh of the list of shares to the server
  --offer-share=PATH USER SHARE_NAME ACCESS_LEVEL
                        Share PATH to USER.
  --list-shared         List the shared path's/shares offered.
  --create-folder=PATH  Create user defined folder in the specified path
  --delete-folder=FOLDER_ID
                        Delete user defined folder in the specified path
  --list-folders        List all the user defined folders
  --subscribe-folder=FOLDER_ID
                        Subscribe to the folder specified by id
  --unsubscribe-folder=FOLDER_ID
                        Unsubscribe from the folder specified by id
  --publish-file=PATH   Publish file publicly.
  --unpublish-file=PATH
                        Stop publishing file publicly.
  --refresh=PATH        Request a refresh of PATH
  --info=PATH           Request the metadata of PATH
  --current-transfers    show the current uploads and downloads
  -q, --quit            Shutdown the syncdaemon
  -c, --connect         Connect the syncdaemon
  -d, --disconnect      Disconnect the syncdaemon
  -s, --status          Get the current status of syncdaemon
  --waiting-content     Get the waiting content list
  --waiting-metadata    Get the waiting metadata list
  --schedule-next=SHARE_ID NODE_ID
                        Move the node to be the next in the queue of waiting
                        commands
  --start               Start syncdaemon if it's not running

Startup and shutdown

Syncdaemon can be autostarted by dbus if something requires it. You might want to use the following switches:

  • --start - starts syncdaemon
  • --connect - asks syncdaemon to connect to UbuntuOne service. Syncdaemon will not connect to it on startup.

  • --status - asks syncdaemon about its status:

    State: QUEUE_MANAGER
        connection: With User With Network
        description: processing queues
        is_connected: True
        is_error: False
        is_online: True
        queues: IDLE

If you need to quit syncdaemon gracefully then you will need to use --quit switch:

$ u1sdtool --quit
ubuntuone-syncdaemon stopped.

Queues

Syncdaemon has two queues that are used to communicate with the server:

  • Metadata queue contains items that describe your data to the server or request the information from the server. Examples of metadata items are MakeFile, ListDir and Unlink. These items do not actually upload or download your content and currently it is mandatory for all metadata queue items to be processed before content queue starts to be processed.

  • Content queue contains the actual uploads/downloads. Once the file has finished uploading/downloading the content queue item is removed from the queue.

You can also see the current state of processing for the content queue item using --current-transfers option:

$ u1sdtool --current-transfers
Current uploads:
  path: /home/rtg/Ubuntu One/museum10.kmz
    deflated size: 977666
    bytes written: 326180
Current downloads: 0

File publishing

To publish the file use --publish-file switch. Please note that this option requires full path to the file to be published and this file should be within Ubuntu One folder or UDF:

$ u1sdtool --publish-file "/home/rtg/Ubuntu One/museum10.kmz"
File is published at http://ubuntuone.com/p/4RQ/

If you no longer want to have the file published, use --unpublish-file option:

$ u1sdtool --unpublish-file=/home/rtg/Ubuntu\ One/museum10.kmz 
File is not published