>  >  

Command-line tools

In order to facilitate interactions with the repository, several command-line tools are available. They provide a convenient way to browse the repository, upload files, create directories, and more.

Two clients are provided: one is written in .Net and available to Windows users as well as Linux users, provided that they use Mono. The other one is written in Perl, and is readily available for Linux users.

 

Repository Client for .Net

Syntax

Options:
u, username Open Xerox User Login
p, password Open Xerox User Password
t, token Open Xerox Token
a, action Required. The main action to call (Get, Post, Put, Delete, Mkdir, Ls, DeleteDir, Login)
l Display full details
s Save token in a given file (or the default user directory)
v Verbose
help Display this help screen.

Command Line Samples :
List Folder Action : ox.exe -a ls /public
 

Download

 You can download this tool on Open Xerox.

Simply unzip the archive and run ox.exe.

 

Repository Client in Perl

Syntax

oxclient.pl [-h][-v][-u user -p pass][-t token][-s server] action...
Options:
    -h           this help
    -v           Verbose
    -q           Quiet (don't print anything)
    -u username  User login
    -p pass      User password
    -t token     Open Xerox token (replaces user/pass)
    -s server    Use 'server' instead of 'https://services.open.xerox.com'

Available actions:
- Repository
    ls                            List directory content
    ll                            List directory content with details
    get /path/to/file [dest]      Retrieve file from repository
    put filename /path/to/file    Upload file to repository
    rm /path/to/file              Delete file from repository
    cat /path/to/file             Print content of file in repository
    mkdir /path/to/dir            Create directory in repository
    rmdir /path/to/dir            Deletes directory in repository
    file_exists /path/to/file     Exit 0 if file exists on repository
    dir_exists /path/to/dir       Exit 0 if directory exists on repository
- User
    login                         Create session and store refresh token
    logout                        Remove tokens from session file
    email login [-s "subject"]    Email text in STDIN to user 'login' 

Examples:
  - List content of /public repository:
oxclient.pl ll /public
  - Login:
./oxclient.pl -u user -p passwd login
  - Upload file:
oxclient.pl put test.png /user/username/dir/test.png
  - Dispay content of file:
oxclient.pl cat /public/info.txt
  - Send email to Open Xerox user jsmith
oxclient.pl email jsmith -s "Hello" < content.txt

Download and installation

You can download the Perl script on Open Xerox.

Before running this application, check that all dependencies are installed by running the command:

sudo apt-get install liblwp-protocol-https-perl libterm-readkey-perl

Run it with "./oxclient.pl"