# Command line tools

Tools for maintaining your UNIX platform

# Current CLI

A new version of the CLI was released on 21. december 2023.  
If you are looking for the old CLI you can find the documentation [here](https://docs.tsnocode.com/books/command-line-tools/page/legacy-cli "Legacy command line tools").

## <span class="mw-headline" id="bkmrk-compatibility-1">Compatibility</span>

The tools are compatible with the following distributions.

- Amazon Linux, version 1, 2 and 2023
- Debian, version 10, 11 and 12
- Armbian, version 10, 11, and 12
- Ubuntu, version 20.04, 22.04 and 24.04
- CentOS, version 8 and 9

The script will check to see if it is running on one of these OSes and stop executing if not.

### <span class="mw-headline" id="bkmrk-running-on-centos-9-1">Running on CentOS 9</span>

You should run this command first.

```bash
dnf install -y wget nano
```

## <span class="mw-headline" id="bkmrk-usage-information-1">Usage information</span>

The Tempus Serva Linux script tools are open source (LGPL), and you are free to use and modify them however you see fit. The tools are defined by one python3 script and a single json file that stores the config.

As the tools themselves are subject to semiautomatic upgrades, we strongly recommend that you keep backups of files you have modified. Future versions of the scripts are not guaranteed to be compatible, with earlier versions or your own modifications.

## <span class="mw-headline" id="bkmrk-installing-the-tool-1">Installing the tool</span>

To install the tools, run:

```bash
wget -qO - https://builds.tsnocode.com/helpers/install | bash
```

This will check compatibility and install the required plugins.

To use the tool, execute `ts`.

On first execution the tool will ask a couple of questions.

Currently the beta release is not implemented for java 11.

## Basic usage

The basic way to use this tool to get an instance running is this:

1. Run the command `ts install`
    1. Accept Java 11
    2. Accept Tomcay 9
    3. Accept alternative user (if prompted)
    4. Set timezone
    5. Accept symlink creation
    6. Choose to install reverse proxy
    7. Choose not to proxy a domain
    8. Optional: Grant TS developers access to ssh into the server
    9. Optional: Install a server banner (shown on login via ssh, recommended)
2. Run the command `ts install-alphaapp`
    1. Optional: Give the app a name (will be shown in the url and is limited to a-Z, 0-9 and -\_)
    2. Optional: Set a new password for the admin user
3. Run the command `ts proxy`
    1. Input the domain(s)
    2. Choose to proxy everything with one domain
    3. Optional: Choose to install ssl 
        1. Input the domain(s)
        2. Optional: overwrite the info-email

## <span class="mw-headline" id="bkmrk-tool-reference-1">Tool reference</span>

To get the full list of commands, and a description, run `ts --help`.

### <span class="mw-headline" id="bkmrk-quick-install-1">quick-install</span>

Installs all the required software to run TS NoCode Platform, a default webapp named 'app' and a redirect from root to 'app'.

It will not ask for anything, but uses default values.

### <span class="mw-headline" id="bkmrk-install-1">install</span>

Installs all the required software to run TS NoCode Platform.

It will ask questions about optional stuff.

### <span class="mw-headline" id="bkmrk-install-app-1">install-app</span>

Will install a new TS NoCode Platform webapp. It ask what release to install from and what name the webapp should be deployed under, if that webapp exists it will ask if you would like to upgrade that installation instead.

### <span class="mw-headline" id="bkmrk-upgrade-app-1">upgrade-app</span>

Will upgrade an existing TS NoCode Platform webapp. It will ask what release to upgrade from and what name the webapp should be deployed under, if that webapp doesn't exist it will do nothing.

### <span class="mw-headline" id="bkmrk-set-admin-password-1">set-admin-password</span>

Will set the admin password for an existing TS NoCode Platform webapp. Will ask what webapp to modify and what the password should be set to.

### <span class="mw-headline" id="bkmrk-install-ssl-1">install-ssl</span>

Will install all dependencies that are needed to setup a LetsEncrypt SSL certificate. Will ask if SSL should be setup once the install completes.

### <span class="mw-headline" id="bkmrk-setup-ssl-1">setup-ssl</span>

Will ask about domain(s) and contact-email, request and install an SSL certificate and setup auto-renewal.

### make-luks

Will help setup LUKS encryption on a secondary drive.  
Must be run before the install-command!

## <span class="mw-headline" id="bkmrk-quick-install-3">Quick install</span>

To quick-install the tool and a webapp run this

```bash
wget -qO - https://builds.tsnocode.com/helpers/install | bash && ts quick-install
```

If you also want to setup SSL, run this

```bash
wget -qO - https://builds.tsnocode.com/helpers/install | bash && ts quick-install && ts install-ssl
```

## <span class="mw-headline" id="bkmrk-removing-the-tools-1">Removing the tools</span>

Remove the two files, eg by running:

```bash
sudo rm /usr/bin/{ts,tsconfig.json}
```

# Legacy CLI

## <span class="mw-headline" id="bkmrk-compatibility-1">Compatibility</span>

The scripts require the use of **Tomcat application server**, primarily for EC2 instances.

The shell tools are compatible with the following distributions

- Amazon linux 2
- Ubuntu Server
- RedHat/CentOS linux (experimental)

Other versions are likely compatible if they support yum installer.

JBoss tools are currently under development (no scheduled release date).

## <span class="mw-headline" id="bkmrk-usage-information-1">Usage information</span>

The Tempus Serva Linux script tools are open source (LGPL), and you are free to use and modify them however you see fit. The tools are defined by all files with the .sh or .bat extension.

As the tools themselves are subject to semiautomatic upgrades, we strongly recommend that you keep backups of files you have modified. Future versions of the scripts are not guaranteed to be compatible, with earlier versions or your own modifications.

## <span class="mw-headline" id="bkmrk-installing-the-tools-1">Installing the tools</span>

Execute the following commands from your UNIX command line

```bash
cd /usr/bin
sudo wget -N https://tempusserva.dk/install/amazon-linux2/script/tsrefreshscripts
sudo chmod 777 tsrefreshscripts
tsrefreshscripts
```

The tools are installed into /usr/bin, and made available for all users with access to the server.

The short-hand version to install the tools is:

```bash
wget -qO - https://tempusserva.dk/scripts | bash
```

## <span class="mw-headline" id="bkmrk-quick-install-1">Quick Install</span>

To quick-install the tools and setup TempusServa, run:

```bash
wget -qO - https://tempusserva.dk/install/amazon-linux2/tsquickinstall | bash
```

## <span class="mw-headline" id="bkmrk-tool-reference-1">Tool reference</span>

All script variables are controlled from a single file

<table id="bkmrk-tsconfiguration-vari"><tbody><tr><td>tsconfiguration</td><td>Variables: Paths for the installation and timezone localization</td></tr></tbody></table>

### <span class="mw-headline" id="bkmrk-installation-1">Installation</span>

All installers will ensure that underlying depencies are installed too

- Java
- Tomcat
- MySQL
- MySQL driver
- TrueType fonts

A check is completed before each install operation

<table id="bkmrk-tsinstall-installs-t"><tbody><tr><td>tsinstall</td><td>Installs Tempus Serva and all dependencies to /TempusServa and names databases: tslive, tstest, tsbase</td></tr><tr><td>tsinstallinstance \[application\]</td><td>Installs Tempus Serva and all dependencies to \[application\] and names the databases \[application\] + postfix: live, test, base</td></tr><tr><td>tsquickinstall</td><td>Installs Tempus Serva and all dependencies to /TempusServa, files are saved to root home folder and names databases: tslive, tstest, tsbase</td></tr><tr><td>tsinstallnightly \[application\]</td><td>Installs Tempus Serva and all dependencies to \[application\] with a nightly build. And names the databases \[application\] + postfix: live, test, base **Note: Use in production environments at your own risc**

</td></tr></tbody></table>

### <span class="mw-headline" id="bkmrk-update-with-newer-ve-1">Update with newer version</span>

During an upgrade the following operations are performed

- Tomcat server is stopped
- Database is backed up
- Binaries are backed up
- New binarys are installed (TempusServa.war)
- New base definitions are imported (**xxx**base database)

Note: Remember to start the server after upgrades

<table id="bkmrk-tsupgrade-upgrades-t"><tbody><tr><td>tsupgrade</td><td>Upgrades the /TempusServa default installation</td></tr><tr><td>tsupgradeinstance \[application\]</td><td>Upgrades the application by the name \[application\]</td></tr><tr><td>tsupgradebetatest \[application\]</td><td>Upgrades the application by the name \[application\] with a nightly build. The backup step is skipped, and the server is automatically started. **Note: Use in production environments at your own risc**

</td></tr></tbody></table>

### <span class="mw-headline" id="bkmrk-system-information-1">System information</span>

<table id="bkmrk-tsstatus-lists-vario"><tbody><tr><td>tsstatus</td><td>Lists various informations - Memory use
- Disk use
- Installed applications
- Running cron jobs

</td></tr><tr><td>tsusageinfo \[instance\]</td><td>Retrieves information from \[instance\] about user and solution names</td></tr><tr><td>tslogsgrep \[search\]</td><td>Fetches information from Tomcat log files, that contains \[search\]</td></tr><tr><td>tslogstail</td><td>Fetches information from Tomcat log files</td></tr></tbody></table>

### <span class="mw-headline" id="bkmrk-server-maintanence-1">Server maintanence</span>

<table id="bkmrk-tsboot-performs-norm"><tbody><tr><td>tsboot</td><td>Performs normal boot operations - Ensures data drive is mounted
- Sets time and routing configuration
- Starts both MySQL AND Tomcat

</td></tr><tr><td>tsstop</td><td>Stops both MySQL AND Tomcat</td></tr><tr><td>tsstart</td><td>Starts both MySQL AND Tomcat</td></tr><tr><td>tsrestart</td><td>Stops Tomcat and starts it again (use: patch, change connection string etc)</td></tr><tr><td>tstomcatstop</td><td>Starts Tomcat</td></tr><tr><td>tstomcatstart</td><td>Stops Tomcat</td></tr><tr><td>tstomcatrestart</td><td>Stops and starts Tomcat</td></tr></tbody></table>

### <span class="mw-headline" id="bkmrk-database-access-1">Database access</span>

Note the following scripts do not take care of firewalls etc.

<table id="bkmrk-tsmysqlremotestart-c"><tbody><tr><td>tsmysqlremotestart</td><td>Creates remote user with DB access and prints credentials to screen</td></tr><tr><td>tsmysqlremotestop</td><td>Removes remote user and permissions</td></tr></tbody></table>

### <span class="mw-headline" id="bkmrk-other-usefull-script-1">Other usefull scripts</span>

<table id="bkmrk-tsbackupfull-backups"><tbody><tr><td>tsbackupfull</td><td>Backups the database and runtime of ALL applications</td></tr><tr><td>tsbackupinstance \[application\]</td><td>Backups the database and runtime of an application named \[application\]</td></tr><tr><td>tsrefreshscripts</td><td>Check for updates and installs new versions of these scripts (ts**xxx**.sh)</td></tr><tr><td>tscloneinstance \[source\] \[target\]</td><td>Make a complete copy of another solution (source)</td></tr></tbody></table>

## <span class="mw-headline" id="bkmrk-removing-the-tools-1">Removing the tools</span>

Execute the following command from your UNIX command line

```bash
wget -qO - https://tempusserva.dk/install/amazon-linux2/clean | sudo bash
```

# Cloud backup overview

Backup of Tempus Serva instances running in AWS is done in the following manner

1. Instance saves .sql for each table in the database
2. Remote backup server 
    - Rsyncs the files from EACH instance
    - Build daily archives containing all .sql files
    - Registers succesfull backup on the monitor server
3. Site 24 polls the monitor server 
    - If failed: Sends warning emails

The backup setup is part of the server creation service

[![image.png](https://docs.tsnocode.com/uploads/images/gallery/2025-10/scaled-1680-/WCfuLcd67i4VZ8up-image.png)](https://docs.tsnocode.com/uploads/images/gallery/2025-10/WCfuLcd67i4VZ8up-image.png)