Command Line Options

Top  Previous  Next

In addition to the standard start, stop, and restart options, the cp30s program supports some other control features to help bootstrap or manage an installation.  Most of these options require that you be logged in as "root" on Linux as an Administrator on Windows.  Many command lines mirror the configuration tools available in the administration browser interface, and also the API.

 

All errors are reported in the syntax "Error: message", providing a pattern to watch for.

 

Optional parameters are shown in brackets ([]).  Do not include the brackets in the command line.

 

Option lists separated by pipes (|) indicate one of the values should be used.

 

Options in italic type indicate variable values you supply.  Options with normal type must be entered as shown.

 

Options that contain spaces or operating system shell characters should be quoted.  It never hurts to quote an option.

 

Common options used by many command lines include:

 

-compid company to set the company to be used for company-specific commands

-pretty changes JSON output to use indention and line breaks for easier readability

-withpassword|-withpass|-wp indicates output that might contain passwords should display the password values, which are otherwise suppressed

-csv|-tsv changes the format of lists to comma-separated values or tab-separated values, instead of the default JSON format

-o "filename" send results to the named file instead of the screen or standard output.  To throw away output, you can use "nul", "null", or "/dev/null" as a filename, interchangeably on any operating system.

-z|-zx "filename" reads the specified text file for further command line arguments.  Any white space, including line breaks, delimit argument values.  If -zx is used, the file is immediately removed after reading.  Use this feature to protect command line elements from being visible in operating system process lists.

 

 

These options do not require a root or Administrator login:

 

cp30s -v displays a version message

 

cp30s -version displays a more verbose version message

 

cp30s -submit filename -target|-targets "loc1:dev1;loc2:dev2;..." -compid company [-props "name1=val1;name2=val2;..."] [-delete]

Submits the file to the specified target or targets in the specified company, optionally with the specified job properties.  The action is always logged.  The targets are identified by location id and device id, and must exist within the company.  If the -delete option is supplied, then filename is deleted once picked up.
 
See 'Put an Output Device' in the API for Output Devices for a list of valid properties.

 

Administrative Options

These options are only supported when logged in as root (Linux) or an administrator (Windows):

 

cp30s start | stop | restart starts, stops, or stops/starts the server.

 

cp30s -update | -updatenow downloads and installs an update to the server software.  Use this to easily update to the latest version or to replace the current version.  The service will briefly stop then restart during the update process.  The -update version prompts for verification, the -updatenow version does not.

 

cp30s -getpass userid  [ -q ]

Gets the password for the site user specified.  The -q option prints only the password, rather than a message.

 

cp30s -resetpass userid [ -password "value" ] [ -o filename ] [ -q ]

Resets the site user password to the supplied value, or a random one, and displays it. The -q option prints only the password, rather than a message.

 

cp30s -get company|siteuser|location|device|source|job|oidc identification commonoptions

Displays a single record in JSON format.  The record must be identified with these options:

-get company -compid compid

-get siteuser -userid userid

-get location -compid compid -locid locid

-get device -compid compid -locid locid -devid devid

-get source -compid compid -srcid srcid

-get job -compid compid -locid locid -devid devid -jobid jobid

-get oidc

 

cp30s -put company|siteuser|location|device|source|oidc identification commonoptions

Updates a single record in the configuration.  The record must be identified like the -get options above, plus you can supply the following data values:

 

Company options

-name "value"

-inactive 0 | 1 (sets the record to active or inactive)

-!isinactive | -isinactive (sets the record to active or inactive)

-maxdevs count

-notes "notes"  (use \n for line breaks)

 

The following options are used for SMTP emailing notifications from this company

-emailto "value"

-emailfrom "value"

-emailserver "value"

-emaillogin "value"

-emailpassword "value"

-sgkey "value"  (SendGrid API key, if set overrides the use of SMTP)

 

The following options are used to define a company-specific URL and certificate:

-externalurl "value"  (i.e https://acmeprinting.example.com)

-sslcertfile "value" (names a certificate file on the CirrusPrint server that services the external URL hostname

-sslkeyfile "value"

 

The following options are used to enable and control direct SMTP submissions to this company.  Note these are inbound submissions, where attachments become input files to deliver to devices.  This is an alternative to IMAP account setup in inbound sources.

-enablesmtp | -!enablesmtp enables or disables inbound SMTP submissions for this company

-smtpallowfrom "value1;value2;..." a semicolon delimited list of email addresses or email domains allows to send submissions.

-smtpsubjectauth "value1;value2" submissions require one value somewhere in the subject (a ~ prefix denotes a regular expression)

-smtpwildcard "value1;value2;..." a semicolon delimited list of wildcards to match attachment file names to (i.e. *.pdf;*.txt)

 

 

Siteuser options

-name "value"

-inactive 0 | 1 (sets the record to active or inactive)

-!isinactive | -isinactive (sets the record to active or inactive)

-isadmin | -!isadmin (sets the user to an admin or non-admin user)

-notes "notes"  (use \n for line breaks)

-validcomps "compid;compid2;..." (sets valid company IDs for non-admin site users)

-notes "notes"  (use \n for line breaks)

-email "value"  (primary email)

-email2 "value" (secondary email)

-phone "value"

-password "value" - must meet site's minimum strength setting, use "!" to auto-generate a password

-allowfrom "ip1;ip2;..." sets a list of valid IP addresses or CIDR values this user can connect from (no value or "any" means from anywhere)

-mfa | -!mfa (sets or unsets multifactor authentication - requires at least one email)

 

 

Location options

-name "value"

-inactive 0 | 1 (sets the record to active or inactive)

-!isinactive | -isinactive (sets the record to active or inactive)

-notes "notes"  (use \n for line breaks)

-type user | 1 | anyvalue (set the location to a browser user, otherwise it is a system location)

-email "value"  (primary email)

-email2 "value" (secondary email)

-phone "value"

-password "value"

-allowfrom "ip1;ip2;..." sets a list of valid IP addresses or CIDR values this location can connect from (no value or "any" means from anywhere)

-mfa | -!mfa (sets or unsets multifactor authentication - requires at least one email, valid for browser user locations)

 

Device options

-name "value"

-inactive 0 | 1 (sets the record to active or inactive)

-!isinactive | -isinactive (sets the record to active or inactive)

-notes "notes"  (use \n for line breaks)

-type file | 1 (set to a file device)

-type command | 2 (set to a command line device)

-type view | viewer | 3 (set to a viewer device)

-type netprinter | 4 (set to a network address or UNC share name)

-type "any other value" (set to a printer device)

-target "value" (sets the target value based on the -type setting)

-formats "fmt1;fmt2;..." (sets raw formats supported by a printer or network printer (pcl, pcl6, ps, txt, any))

-filter "commandline" (a server-side command line with %i, %o, %e substitution tags, converts input file to output format for delivery)

-defaultprops "p1=v1;p2=v2;..." (sets default properties for PDF documents sent to a printer, as name=value pairs)

color=0|1|2 (b&w, gray, color)

copies=n

collate=0|1 (no copy collation, collate copies)

duplex=0|1|2 (simplex, duplex vertical, duplex horizontal)

orientation=1|2 (portrait, landscape)

priority=0..99

tray=name (as reported by system client)

scale=0|1|2 ( 0=fit, 1=shrink to fit, 2=actual size)

size=name (as reported by system client, such as letter, legal, a4)

custsize=value to override the size name, or on Linux, other media options

 

Source options

-name "value"

-inactive 0 | 1 (sets the record to active or inactive)

-!isinactive | -isinactive (sets the record to active or inactive)

-notes "notes"  (use \n for line breaks)

-type path | 0 (file path source)

-type port | 1 (network port source)

-type email | 2 (IMAP client source)

-source "value" (type-specific input source)

Path sources require a file system path or designated system location)

Port sources require a port number on the server or designated system location)

Email sources require a mailbox as well as server and authentication informaiton

-locid "locid" (path and port sources can be located at a system client, and default to the server)

-wildcard "value1;value2;..." a semicolon delimited list of wildcards to match file names to (i.e. *.pdf;*.txt)

-targets "locid:devid;locid2:devid2;..." one or more targets to deliver documents to - a target is a location:device colon-separated pair

 

-allowfrom "ip1;ip2;..." for port sources, sets a list of valid IP addresses or CIDR values that can submit to this source

 

Email sources can identify targets from email data, such as To addresses, so targets are optional for email sources

-imapserver "value" (IMAP server for email source)

-imappassword "value" (Password for authenticating the source address)

-allowfrom "address;domain;..." for email sources, sets a list of valid from address or domain names to accept email from

-imapsubjectauth "value1;value2" submissions require one value somewhere in the subject (a ~ prefix denotes a regular expression)

 

OIDC options

-provider "provider-url" sets the url or domain of the OIDC provider.  The provider's /.well-known/openid-configuration page must be accessible.  Set to "" to turn off OIDC usage.

-clientid "clientid" sets the application registration client ID value

-clientsecret "secret" sets the application registration client secret value

 

 

cp30s -delete company|siteuser|location|device|source identification commonoptions

Deletes a single record.  The record must be identified with these options:

-delete company -compid compid

-delete siteuser -userid userid

-delete location -compid compid -locid locid

-delete device -compid compid -locid locid -devid devid

-delete source -compid compid -srcid srcid

 

cp30s -copy company|siteuser|location|device|source identification options

Copies a single record to another unique name, optionally removing the original (effectively a rename).  Use one of these formats:

-copy company -compid compid -to compid [-rename]

-copy siteuser -userid userid -to userid [-rename]

-copy location -compid compid -locid locid -to locid [-rename]

-copy device -compid compid -locid locid -devid devid -to devid [-rename]

-copy source -compid compid -srcid srcid -to srcid [-rename]

 

cp30s -list company|siteuser|location|device|source|sitedevices options

Lists records, by default in JSON format, with optional -pretty option, or else as a CSV or TSV file with -csv or -tsv options.  You can also use companies, siteusers, locations, devices, or sources as plural versions of the above options.

-list company|companies [-complist "comp1;comp2;..."] (use -complist to show only company IDs specified)

-list siteuser|siteusers

-list location|locations -compid "compid"

-list device|devices -compid "compid" -locid "locid"

-list source|sources -compid "compid"

-list sitedevices [-compid "compid"] (lists all devices at all locations, optionally for one company)

-list connections [-since timecode] lists client/browser connections since the time code (number followed by s,m,h, or d - 60s, 10m, 6h, 1d)

 

For TSV and CSV formats, array values are strings separated by semicolons.

 

The location printers list configuration values are pipe-separated rather than tab-separated.

 

cp30s -enable|-disable location|device|source options

Enable or disable one or more records, as specified:

-enable|-disable location -ids "locid1;locid2;..."

-enable|-disable device -ids "locid1:devid1;locid2:devid2;..."

-enable -disable source -ids "srcid1;srcid2;..."

 

cp30s -checkfile filename

Reports information about filename including the analyzed file type, MIME type, and whether or not the file is considered complete, such as ensuring PDF files contain a trailer string, and XML files include the closing root tag.

 

Incomplete files are not picked up from inbound path sources.

 

cp30s -installcert -certfile path-to-cert-chain-file -keyfile path-to-key-file [-global] [-compid compid]

Installs the named SSL certificate files into config.ini, or data/gconfig.ini if the -global flag is used, or to the company ID specified if the -compid compid value is specified.  If a full chain certificate file is available, that should be used in preference to the single certificate file.  The certificate and key file are verified for a match, but you must ensure they will be readable by the CirrusPrint server user.

 

After this is done, the server must be restarted for the new certificate to take effect.

 

For more information, see the SSL Certificates chapter.

 

Linux: sudo cp30s -lecerts /root/.acme.sh/acme.sh [-global]

Windows: cp30s.exe -lecerts \path\to\wacs.exe -email your-email [-global]

These commands use one of two third party tools to issue and install Let's Encrypt SSL certificates for the site domain referenced in the External URL of the site configuration.  If -global is supplied, the certificate is stored in the global config (data/gconfig.ini) file.

 

For more information, see the SSL Certificates chapter.