CLI Installation
Published 30 November 2021
Our command line tool rgclone is hosted directly in the server and can be downloaded via our Web API (through a download endpoint).
This also means that installation and upgrades are basically identical as they require this download to your local machine.
Contents
Web API endpoint
To download and configure the rgclone
CLI you'll need to provide an URL of the Redgate Clone API endpoint (<web-api-endpoint> from now on), in this format:
Web API Endpoint
Managed (AKS) clusters: https://<instance-dns-address>
Embedded (VM) clusters: https://<instance-dns-address>:8132
Installation
Supported architectures:
- windows-amd64
- linux-amd64
All distributions of rgclone
are packaged using a standard package tool for the target platform: tar.gz
for Linux and zip
for Windows.
Set the
rgclone
endpoint in your environment based on the web API:# Command ## Linux export RGCLONE_API_ENDPOINT=<web-api-endpoint> ## Windows setx RGCLONE_API_ENDPOINT <web-api-endpoint> # Examples ## In Windows (VM) setx RGCLONE_API_ENDPOINT https://examplednsaddress.com:8132 ## In Windows (AKS) setx RGCLONE_API_ENDPOINT https://examplednsaddress.com ## In Linux (VM) export RGCLONE_API_ENDPOINT=https://examplednsaddress.com:8132 ## In Linux (AKS) export RGCLONE_API_ENDPOINT=https://examplednsaddress.com
Download
rgclone
for your architecture from<web-api-endpoint>/cloning-api/
download/cli/<architecture>
.For Windows this will be a zip file containing the
rgclone
executable that you can download and extract and for Linux it will be atar.gz
file that you can extract, for example:# Linux curl $RGCLONE_API_ENDPOINT/cloning-api/download/cli/linux-amd64 | tar xz # Windows (Powershell) Invoke-WebRequest -Uri "$env:RGCLONE_API_ENDPOINT/cloning-api/download/cli/windows-amd64" -OutFile "windows-amd64.zip" Expand-Archive -LiteralPath "windows-amd64.zip" -DestinationPath "."
If you want to use
rgclone
from the CLI from any location (other than the directory it was extracted in) you will need to add it to your PATH environment variable, or create a symlink to your local binaries directory. Make sure you change the path placeholders below:## Option 1 - Adding to your PATH file # Linux echo "export PATH=$PATH:<path to rgclone directory>" >> ~/.profile # (Windows Powershell as Admin) [Environment]::SetEnvironmentVariable('Path', $env:Path + ';<path to rgclone directory>', 'Machine') # (Windows cmd as Admin) powershell -command "[Environment]::SetEnvironmentVariable('Path', $env:Path + ';<path to rgclone directory>', 'Machine')" ## Option 2 (Linux) - Setting a symlink sudo cp -s <path to rgclone executable> /usr/local/bin/rgclone
- You should now be able to run
rgclone version
to verify the CLI is functioning correctly and connected to the server.
Authenticate
rgclone
using the access token you configured in the Admin Console. You can make this persistent (e.g. for usage in CI/CD pipelines) by setting an environment variable.
Checksum
You can obtain a checksum for the CLI from the <download address>/checksum endpoint
Upgrades
Since the latest version of rgclone
is hosted in the server, you can upgrade by simply repeating the installation steps above whenever a new version is available.
The tool will automatically detect if you are running an older (or newer) version of rgclone after running any command and issue a recommendation to update:
The message will be slightly different if you are running a newer version (e.g. if a server downgrade happened):