# Linux machine

Source: https://userguide.qualytics.io/operation-automation/linux-machine/

You can automate Qualytics operations on a Linux machine by scheduling them with cron jobs. This guide walks you through setting up a scheduled curl command to trigger exports at defined intervals.

## Prerequisites

Before proceeding, ensure that you have the following:

1. Access to the terminal on your machine.
2. The `curl` command-line tool installed.
3. The desired Qualytics instance details, including the instance URL and authentication token.

## Steps to Create a Scheduled Operation

### 1. Open the Crontab Editor

Run the following command in your terminal to open the crontab editor:

```bash
crontab -e
```

### 2. Add the Cron Job Entry

In the crontab editor, add the following line to execute the curl command at your specified schedule. Replace `<asset-type>` with `anomalies`, `checks`, or `profiles`. See the [Export Operation API](https://userguide.qualytics.io/operations/export-operation/api/) for every field the request accepts.

```bash
<cronjob-expression> /usr/bin/curl --request POST --url 'https://<your-instance>.qualytics.io/api/operations/run' --header 'Authorization: Bearer <your-token>' --header 'Content-Type: application/json' --data '{"type": "export", "datastore_id": <datastore-id>, "asset_type": "<asset-type>", "container_ids": [<container-id-one>, <container-id-two>]}' >> <path-to-show-logs> 2>&1
```

### 3. Example:

For example, to run the command every 5 minutes:

```bash
*/5 * * * * /usr/bin/curl --request POST --url 'https://your-instance.qualytics.io/api/operations/run' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' --header 'Content-Type: application/json' --data '{"type": "export", "datastore_id": 123, "asset_type": "anomalies", "container_ids": [14, 16]}' >> /path/to/show/logs.txt 2>&1
```

### 4. Verify or List Cron Jobs:

```bash
crontab -l
```

Customize the placeholders based on your specific details and requirements. Save the crontab file to activate the scheduled operation.

*Last updated: October 7, 2026.*
