All Collections
Troubleshooting and How-To
How-To Articles
How to remove user data to meet GDPR compliance (On-Premise)
How to remove user data to meet GDPR compliance (On-Premise)
A
Written by Arick Disilva
Updated over a week ago

Introduction

From Platform Release 637, a new function, remove_user_data_ex is being added to the Teramind standard Perl script, tm.pl that comes with the On-Premise deployment package. This function will help you easily remove users’ data to meet GDPR compliance such as Right to erasure / Right to be forgotten (i.e., Article 17 and 19).

Notes

  • You can run the remove_user_data_ex function either on the Master node (a VM with the master role) or a BI node (a VM with the terabi role).

  • You can run the function on the Master node only if there is no BI node.

  • The function removes data such as user activities, BI reports, etc. from the PostgreSQL and ClickHouse databases. It does not remove video recordings, captured email attachments, captured printed documents, etc.

Removing Data Manually

You can then delete the data using the following command:

/usr/local/teramind/scripts/tm.pl -func remove_user_data_ex [-keep_month N] [-computer COMPUTER_ID] [-user USER_EMAIL] [-y] [-no_disk_check]

Description of Parameters

Parameter

Description

-keep_month N

This parameter will delete monitoring data older than N months, not including the current month. For example, if it’s May, and you use -keep_month 3, data for February, March, April, and May will be kept and the rest will be deleted.

If you pass this parameter a 0 value, only the current month’s data will be kept.

If you pass any negative number (e.g., -1), all monitoring data will be deleted.

-computer COMPUTER_ID

This parameter will delete data for a computer with the ID COMPUTER_ID. You can find a computer’s ID by navigating to the COMPUTERS > Computer's details page on the Teramind Dashboard and then extract the ID from the URL.

For example, https://democompany.teramind.co/#/computer/3 (in this case, the computer’s ID is 3):

If you use this parameter with the -keep_month parameter, the script will delete only the monitoring data of users on the computer. It will not delete any computer settings or records (e.g., computer's name, last connection time, etc.) of the computer itself.

If the -keep_month parameter is not provided, it will delete all data including monitoring data of all users on the computer, the computer's records, and the computer's settings.

⚠️ You cannot use this parameter with the -user parameter.

-user USER_EMAIL

This parameter will delete data for a user with the email address specified in the USER_EMAIL. For example, [email protected].

If you use this parameter with the -keep_month parameter, the script will delete only the monitoring data of the user. It will not delete any user settings or user records (e.g., report settings, troubleshooting settings, etc.).

If the -keep_month parameter is not provided, it will delete all data of the user including monitoring data, user's records, and user's settings.

⚠️ You cannot use this parameter with the -computer parameter.

-y

If you use this parameter, the script will not ask you to confirm the delete operation.

- no_disk_check

Use this parameter if you don't have the main PostgreSQL database located on the Master node. Note that, if you use this parameter, you will have to ensure that the database has enough free space for the cleanup operations.

⚠️ This parameter is required for remote database(s).

Examples

1. The following command will delete data older than 5 months (not including the current month) from a computer with an ID of 112:

/usr/local/teramind/scripts/tm.pl -func remove_user_data_ex -computer 112 -keep_month 5

2. This will delete all the data of a user who has the email address [email protected]:

/usr/local/teramind/scripts/tm.pl -func remove_user_data_ex -user [email protected]

3. This will delete all monitoring data of all users and computers:

/usr/local/teramind/scripts/tm.pl -func remove_user_data_ex -keep_month -1

Removing Data Automatically

You can set up a Cron job to automatically clean data on a regular basis by editing the user’s crontab file:

1. Use the following command to open the crontab file for editing:

crontab -e

2. Add the tm.pl command with the remove_user_data_ex function and the required parameters as needed in the crontab file. For example, the command below will run the delete operation everyday at midnight. It will keep the last six months of monitoring data and delete the rest. It will also create an output log in case you want to capture any exceptions:

0 0 * * * /usr/local/teramind/scripts/tm.pl -func remove_user_data_ex -y -keep_months 6 -no_disk_check >>/usr/local/teramind/logs/remove_user_data.log 2>&1
Did this answer your question?