EN Snapshot rotate - titandc/titan-sc-documentation GitHub Wiki
Preface
This procedure explains how to take automatic snapshots of your servers hosted on Titan SmallCloud from a Windows machine.
Requirements
First of all, it is necessary to create an API key on the SC interface of Titan Datacenter.
Linux
Installing the tool
On the releases page of the GitHub project, download the latest version of the tool:
# Adapt the version number if an update is available
wget https://github.com/titandc/titan-sc-cli/releases/download/v3.0.6/linux-amd64.tgz
# Untar the tool
tar zxf linux-amd64.tgz
cd linux-amd64
# Copy the binary to /usr/local/bin/ and create the configuration file
./titan-sc setup --token "API TOKEN"
# Clean up
cd ..
rm -r linux-amd64
Create the scheduled task
To create the scheduled task, run the following command (please adapt the trigger time of the snapshots to fit with your needs) :
echo "30 3 * * * root /usr/local/bin/titan-sc snapshot rotate --server-uuid <server_uuid> -f" >> /etc/crontab
The previous example will run every day at 3:30 am.
Windows
titan-sc
tool
Installation of the In the rest of this documentation, the tool will be installed in the C:\Program Files\titan-sc\
directory. It is possible to install it elsewhere by adapting the paths.
First, it is necessary to download and unzip the latest version of the titan-sc-cli tool for Windows.
Create the installation directory C:\Program Files\titan-sc\
and copy the file from the archive titan-sc.exe
to the directory C:\Program Files\titan-sc\
.
Open a Powershell then launch the setup:
cd "C:\Program Files\titan-sc\"
.\titan-sc.exe setup --token "API TOKEN"
The API key can be found/generated on the Titan SmallCloud interface, by clicking on its avatar (top right of the interface) then API keys
.
A configuration file has been created in the installation directory of the tool in C:\Program Files\titan-sc\config
.
The installation of titan-sc-cli
is now complete.
Create the scheduled task
Open the Windows task scheduler: taskschd.msc
.
In the right panel, click on the Create task
button then configure the task:
In the Triggers
tab, click on the New
button to add a trigger element. Please note that the minimum wait time between snapshots is 30 minutes. If a snapshot is triggered less than 30 minutes before the previous one, an error will be returned.
We recommend taking snapshots at least every two days:
- Monday
- Wednesday
- Friday
Thus, if a problem arises, it is possible to restore a snapshot that is several days old.
In the Actions
tab, click on the New
button.
Program/script
: By clicking on theBrowse
button, find the executabletitan-sc.exe
. In the example:"C:\Program Files\titan-sc\titan-sc.exe"
Add arguments (optional)
: Arguments of the binary for the execution of the chosen command. Here:snapshot rotate --server-uuid <server_uuid> -f
. The<server_uuid>
can be found on the Titan SmallCloud interface, on the server page, by clicking the "More information" button.Start in (optional)
: Directory for executing the task. In our case, it is necessary to enter the path where the binary is located to allow reading of the configuration file:C:\Program Files\titan-sc\
Validate the creation of the task.
You can test the execution of the task by clicking on the Run
button on the right panel in order to check that it works well (be careful to respect a minimum delay of 30 minutes between taking snapshots of same machine).
The created snapshot can be viewed from the Titan SmallCloud interface.