Configure periodic backups
Learn how to configure automatic periodic backups.
You can configure ThoughtSpot to backup automatically at specified times. The policy allows you to control the type, frequency, retention periods (first-in-first-out), and output location for a periodic backup.
A periodic backup uses the same steps as creating a backup manually. However, you do not have to specify a snapshot name. The system uses the most recent snapshot. You can backup to a local file system, mount a NAS (network attached storage) file system to hold the backup, or back up to an S3 bucket. A NAS file system is recommended. Make sure you have adequate space to store the number of backups you want to archive.
Default policy format
This is the format for a backup policy.
Note that the command populates several parameters with their defaults.
The default mode
is FULL
, the type
is STANDALONE
, and the storage_type
is NAS
.
You can change the mode
and storage_type
, and you must specify a directory
and a name
.
The longest possible backup schedule you can configure is one week. This configuration should be entered as:
ThoughtSpot does not generate an error for periods greater than seven days, but the snapshot will not be created. |
name: "name_for_backup"
param {
mode: FULL | DATALESS | LIGHTWEIGHT
type: STANDALONE
}
schedule {
period {
number: integer
unit: MINUTE | HOUR | DAY
}
retention_policy {
time {
number: integer
unit: MINUTE | HOUR | DAY
}
capacity: integer
}
}
offset_minutes_from_sunday_midnight: integer
}
directory: "NAME"
storage_type: NAS | LOCAL | S3
enabled: true (you only need this parameter if your storage_type is S3)
bucket_name: "your-S3-bucket-name-in-quotes" (You only need this parameter if your storage_type is S3. The bucket name must be in quotes.)
To periodically back up your cluster to an S3 bucket, specify S3 for the storage_type , and include the enabled and bucket_name parameters.
|
Before you begin
Before creating a policy, make sure you have read Understand backup/snapshot schedules for information on configuring a schedule
element.
In addition, you must specify the following parameters:
Element | Description |
---|---|
|
Specify a name for your backup, so you can identify it later. |
|
The backup mode.
|
|
Only |
|
The location on the disk to place the backup.
You specify an existing directory path, but the folder (the last part of the path: |
|
The type of storage you are using.
|
Create a backup policy
Backups cannot start when another backup is still running.
Choose a reasonable frequency for the backup mode in your policy.
For example, a FULL
backup takes longer than a DATALESS
backup.
Consider the load on the system when configuring.
Do not back up when the system would experience a heavy load.
For example, you may want to take FULL
backups late in the evening or on weekends.
The retention system deletes the oldest stored backup and the corresponding snapshot on a first-in-first-out basis (FIFO). This means that if you set a bucket retention of 1, the system stores a single backup at any one time. The system deletes the older backup after the new full backup is successful.
Configure using tscli
To configure periodic backups using the tscli:
-
Log in to the Linux shell using SSH.
$ ssh admin@<cluster-IP>
-
Find a directory with enough disk space to support the
retention_policy number
you configure.You can use
df -h
to see free disk space andtscli snapshot ls
to view existing snapshots and their size on disk. -
Use the
tscli backup-policy create
command.$ tscli backup-policy create
The command opens a
vi
editor for you to configure the backup policy. -
Write and save the file to store your configuration.
By default, newly created policies are automatically enabled. To disable a policy, use the
tscli backup-policy disable
command.
Doing more with backup
The following table lists some additional backup commands you can use.
To | Command |
---|---|
List present backup policies. |
|
Show a backup policy. |
|
Check the status of a policy. |
|
Change an existing policy. |
|
Disable or enable an existing policy. |
|
Delete a policy |
|
Finally, you can time a crontab
job with your periodic backup configuration to move a backup to longer term storage.
Simply create a crontab
job that moves the backup to a location outside of the directory
defined in the periodic schedule.