Command line interface

Aside from using a browser, the Enterprise edition of SynaMan offers a command line version allowing users to upload and download files using scripts. The command line interface (CLI) supports both uploading and downloading files with wildcards.

SynaMan CLI, as the name suggests, is only available as a command line tool. There is no GUI. It is intended for users who want to write scripts for uploading and downloading files to a machine where SynaMan is running.

Prerequisites and Download

The CLI for SynaMan requires Java Runtime installed on the machine. Supported versions are JRE 1.6 or above.
  • Click here to download an EXE file for Windows
  • Click here to download a JAR file for other operating systems.
  • Click here to download a zipped file containing EXE as well as the JAR file.

Usage

The following method is used to run SynaMan CLI
SynaManCLI.exe <Param1Name> <Param1Value> ... <ParamNName> <ParamNValue>
OR
java -jar SynaManCLI.jar <Param1Name> <Param1Value> ... <ParamNName> <ParamNValue>


The first example will only work on Windows. The 2nd example will work on any operating system (including Windows, Linux, Mac and UNIX) as long as Java is installed and is in the PATH.

Parameters
Parameters take a form of: -Name Value

Following is a list of valid parameters:
-lpath - Local path

Refers to relative or absolute path on the client machine. It refers to a folder name if operation is download, downloadFolder or uploadFolder. It refers to a file if operation is upload.

-o - Operation (required parameter)

This parameter defines the operation you want to perform. The value portion of this parameter can either take a case-insensitive work or a case-sensitive single letter. Valid values are:

  • download or D - Used to download a single file or multiple files with a wildcard character.
  • downloadFolder or F - Used to download a folder recursively
  • upload or U - Used to upload a single file or multiple files with a wildcard character.
  • uploadFolder or P - Used to upload a single folder recursively
  • dir or L - Fetch directory contents

-p - User's password (required parameter)

User's password

-s - Server's URL (required parameter)

Refers to the URL where SynaMan is running. For example: http://yourServer.com:6060 or https://secure.yourServer.com

-shf - Shared Folder name (required parameter)

Refers to the shared folder name. This MUST refer to an existing shared folder name. Use $HOME to specify user's home folder.

-spath - Server's path

Relative path on the SynaMan server with respect to the shared folder name. This refers to a folder name if operation is upload, uploadFolder or downloadFolder. It is a file if the path is downloadFolder.

-u - User's login (required parameter)

User's login ID

-gullible (optional parameter)

If -gullible is passed as a parameter, SynaMan CLI will ignore invalid or non-trusted certificates on secure ports. This is useful if your attempting to access a SynaMan running on HTTPS with an expired or invalid certificate.

Example 1
Uploading a file called POC.doc to a shared folder called Important Files with a relative path set to Project 1/JohnD. Notice the use of double quotes when a parameter value contains an embedded space.
SynaManCLI -o upload -s https://myServer -u John.Doe@xyz.com -p secret007 -shf "Important Files" -spath "Project 1/JohnD" -lpath POC.doc
Example 2
Downloading the file uploaded in example 1. The file will be downloaded in the folder C:\temp. If lpath parameter is missing, the file will be downloaded in the current directory.
SynaManCLI -o download -s https://myServer -u John.Doe@xyz.com -p secret007 -shf "Important Files" -spath "Project 1/JohnD/POC.doc" -lpath C:\temp
Example 3
Uploading an entire folder C:\MyProjectFiles to the server.
SynaManCLI -o uploadFolder -s https://myServer -u John.Doe@xyz.com -p secret007 -shf "Important Files" -spath "Project 2/JaneD" -lpath C:\MyProjectFiles
Example 4
Downloading an entire folder Project 3 to the local machine
SynaManCLI -o downloadFolder -s https://myServer -u John.Doe@xyz.com -p secret007 -shf "Important Files" -spath "Project 3" -lpath C:\MyProjectFiles

Troubleshooting Tips

Using Special Characters in password
It is common to use special characters, such as space or punctuations, for password. In such cases, you will have to follow the rules of your operating system on how to use these characters. Consider the examples below that show the use of the password argument.

Example 1

-p Hello""World
In the above example, there is 1 double-quote between Hello and World. However, you will have to specify that twice. The first is used as a escape character.

Example 2

-p "%%q,{e@hV(?>!D"

This is a more complex example with multiple special characters. The actual value for the password is %q,{e@hV(?>!D. Notice it contains a % sign and a > character within the password. Both are special cases since they have a special meaning when used in scripts on Windows operating system. Two changes are required in order to use these values:

  • The entire password field is enclosed within double-quotes. This takes care of the > sign, which is typically interpreted as a redirection character on shell.
  • The % sign is specified twice, similar to example 1.

Navigation

Social Media

Powered by 10MinutesWeb.com