Background Tasks
Package: BASIC
1. General
Scheduled background tasks (Cronjobs) can be used to run actions automatically.
Background task “Reports scheduling”: This background task automatically sends Reports to selected email recipients (users or groups) at the times defined in the report. Depending on the configuration, the reports are included as a PDF, CSV, or both as an attachment.
Example: On the 1st of every month, the managing director receives the current revenue figures for the previous month.
1.1. Overview of background tasks
Under the settings item “Global settings - System Automation - Background tasks” an overview of the background tasks is displayed, where they can also be configured:
System Automation - Background tasks
The background tasks are divided thematically into three areas (see screenshots above):
1.2. Column headings
Each thematic area of the background tasks has a tabular overview with the following table headers:
- Status → Indicates whether the background task is active/inactive. Using the switch, the background task can be activated (switch to the right and switch colour orange) or deactivated (switch to the left and switch colour grey).
- Name → Name of the background task. On mouseover a short description of this background task is displayed.
- Defined interval → Displays the defined interval at which the background task is run. Times are given here in UTC (e.g. “Every day, at 1:00” = 02:00 CET or 03:00 CEST).
- Last run → Displays the date and time when the background task was last run. The display is in local time (CET or CEST).
- Next run → Displays the date and time when the background task will next run. The display is in local time (CET or CEST).
- Running since → If a background task is currently running, it shows since when it has been running.
- Last edited by → Displays which user last edited the background task.
- Last edited on → Displays when the background task was last edited.
- Action → Clicking the “three dots” icon displays the available actions for the respective background task.
2. Background tasks and their functions
The times in the recommended interval column are given in UTC (e.g. 01:00 UTC = 02:00 CET or 03:00 CEST).
2.1. Standard
| Background task | Description | recommended interval |
|---|---|---|
| Reports scheduling | The background task automatically sends Reports to selected email recipients (users or groups) at fixed defined times. The reports are included as a PDF, CSV, or PowerPoint file (for report sets) as an attachment. | Every 15 minutes |
| CSV Update | This background task controls the intervals at which any available CSV update definitions are searched for and then processed. | Every minute |
| CSV/ICS Import | This background task controls the intervals at which any available CSV import definitions are searched for and then processed. | Every hour |
| Exchange Online | The background task is required to maintain user authentications between the brainX system and an Exchange server. In addition, any interrupted synchronisations can be resumed and completed. | 4 times a day |
| Geodata determination | The background task governs the interval at which the geodata of new records are determined. | Every 5 minutes |
| Deletion routine | The background task automatically deletes records in the Recycle Bin module at the defined time interval. | Every day at 03:00 |
| OAuth refresh | The background task ensures that existing OAuth authentications of email accounts do not expire. Email accounts, the central mail server and the Exchange Online integration can be connected via OAuth authentication. | Every 15 minutes |
| PDF Export | This task runs the bulk export of PDF files in list views. | Every minute |
| Match SMS list | Matches the list of SMS at the phone provider and stores them in the Connect module. | Every minute |
| Overdue Tasks | This background task checks whether there are Tasks whose end lies in the past and gives these the status “overdue”. | Every day at 02:00 |
| Delayed sending | Sends emails marked with the status “Delayed sending”. | Every minute |
2.2. System
| Background task | Description | recommended interval |
|---|---|---|
| Process asynchronous messages | Runs asynchronous actions such as Exchange synchronisation or time-delayed Automations. | Every minute |
| Tasks & Appointments reminder | This background task sends notifications about upcoming tasks and appointments to the responsible user. For this, a reminder must also be configured for a task or appointment. | Every minute |
| Automation: Email Scanner | Required to run the scanning of email accounts configured in Automations. | Every 5 minutes |
| Background Worker | Runs processes and functions relevant to brainX operation in the background. | Every minute |
| Holiday appointments | Keeps the holiday appointments in the calendar up to date (see Appointments – Show holidays). The background task must be activated once. | Every day at 03:00 |
| Birthday appointments | The background task creates corresponding entries in the Appointments module. The background task is automatically activated when the “Show birthdays” function is used in the module manager (Appointments module - Basic configuration). | Every day at 00:00 |
| Scheduled Actions: Clean up history | Runs daily and removes executed Scheduled Actions that are older than 30 days. | Every day at 03:30 |
| SFTP Backup | Creates a backup of the database and all file attachments once a day and transfers it to a dedicated SFTP server. Setup is described in section 4.2. Setting up SFTP Backup. | Every day at 01:00 |
Background tasks in the “System” section cannot be edited directly!
2.3. Integrations
| Background task | Description | recommended interval |
|---|---|---|
| Email Marketing Events | Synchronises the events (sign-ups and sign-offs, hard bounces) of all existing Email Marketing accounts. | Every minute |
| Email Marketing Statistics | Synchronises the statistics of all email campaigns of all existing Email Marketing accounts. | 18 times a day |
| Billing - Contract billing [1] | Automatically creates Invoices based on Contracts. | Every day at 01:00 |
| Billing - Contract change interim invoice [1] | Automatically creates interim invoices based on Contracts. | Every day at 03:00 |
| Jira Service Management customers | Creates or deletes customers in Jira Service Management. The permitted access period can be stored in the respective contact. | Once per hour |
| Sales Viewer | The background task automatically transfers the data determined in SalesViewer to brainX via the API (interface). Records are created in the Leads and Website Visits modules. | Once per hour |
| Time tracking | This background task is used to synchronise data between brainX and an external time-tracking service provider. For more information, see section Time tracking. | Every minute |
[1] Only available in the brainX version “brainX APP”!
3. Activating/deactivating and configuring background tasks
The settings (status active/inactive and the configuration) of running background tasks (status = running) cannot be changed.
3.1. Activating a background task
An inactive background task is activated using the switch in the first column “Status”.
3.2. Deactivating a background task
An active background task is deactivated using the switch in the first column “Status”.
3.3. Editing a background task
In the last column of the overview of background tasks is the “three dots” icon. After clicking it, a flyout menu opens with the actions
- Edit → only available if the background task is editable at all
- Run cronjob now → only available for active background tasks
For individual background tasks (e.g. SFTP Backup), dedicated actions such as Settings and Log are available instead (see section 4.2. Setting up SFTP Backup).
Background task actions
Alternatively, clicking the interval in the “Defined interval” column opens the editing, provided the background task is editable.
In the “Settings for …” popup, Name and Status are displayed. In the Scheduling area, the run times are selected in the Minute, Hour, Month, Day and Weekday sections; via “Templates” common intervals can be applied. Using the “Select all” and “Deselect all” buttons, all values of a section can be set at once. At the bottom, the Preview summarises the selection, e.g. “7 times per hour, 20 hours per day, 30 days per month, 2 months per year, 6 days per week”.
3.4. Resetting a background task
It can happen that a background task is no longer processed server-side due to an execution error and remains permanently in the “running” state.
In general, the Technology or Support department of brainX GmbH is automatically notified by the system if a background task has become stuck.
If you have the impression that a background task has been stuck for a longer time or is no longer being run, please contact the support of brainX GmbH.
In the case of in-house installations, the user CustomerAdmin has the permission level Admin (see section Users and permissions – Administrative permissions), which allows the resetting and restarting of background tasks.
If a background task becomes stuck, this is indicated in the list of background tasks by the “circular arrows” icon. By clicking the icon, the affected background task can be reset or restarted. In addition, the system automatically informs the user admin by email about the affected background task – provided that the monitoring email is configured.
4. Further settings
4.1. Background task monitoring email
The background task “Monitoring email” is only available in the brainX variant “InHouse”!
Via the “three dots” action icon in the row of the background task, the action “Further settings” can be called up. After clicking the action “Further settings”, the popup window “Further settings” opens.
In the field “Cronjob monitoring email” an email address can be stored to which the system automatically sends a notification when a background task does not complete as expected. The notification contains details about the affected background task as well as the time of the error.
4.2. Setting up SFTP Backup
brainX GmbH backs up the database and the storage folder (storage location for images, documents, etc.) of all cloud systems daily. These backups are available retrospectively for the last 7 days. Older backups are automatically deleted.
With SFTP Backup, you can additionally set up your own backup. It transfers the database and all file attachments as a ZIP file once a day to a dedicated SFTP server. This way, an independent copy of the user data is held in your own infrastructure.
Each SFTP backup file contains a “How-to-use guide” in PDF format.
When setting up SFTP Backup, please contact brainX GmbH, as a so-called “handshake” has to be performed and the server key confirmed.
Prerequisites
- A reachable SFTP server with a user account that has write permissions in the target directory.
- A configured mail server for email notifications.
Calling up the settings
In the overview of background tasks (area System), click the “three dots” icon in the “SFTP Backup” row. The flyout menu contains the actions:
- Settings → opens the popup for setting up SFTP Backup
- Log → displays the previous backup runs
SFTP Backup - flyout menu
Configuring SFTP Backup
After clicking Settings, the “Settings” popup opens:
SFTP Backup - Settings popup
| Field | Explanation |
|---|---|
| SFTP Backup active | Switch to activate SFTP Backup (switch to the right) or deactivate it (switch to the left). |
| SFTP Port * | Port of the SFTP server. The default port 22 is preset. |
| SFTP Server * | Address (hostname or IP address) of the SFTP server. |
| SFTP User * | Username for logging in to the SFTP server. |
| SFTP Password * | Password of the SFTP user. The following characters are currently not allowed: & # ; | * ? ~ < > ^ ( ) [ ] { } $ \ |
| SFTP Target directory * | Directory on the SFTP server in which the backup is stored. SFTP always requires the absolute path (e.g. /home/backup/brainx). |
| Email notification | User or group that is notified by email after a backup has been created. The selection is made via a list with a search field. Default value: --none--. |
* Mandatory field
With “Save” the settings are applied. If the SFTP Backup active switch is turned on, the background task “SFTP Backup” is automatically activated. It runs every day at 01:00 UTC, i.e. at 02:00 CET or 03:00 CEST. The run time and interval cannot be changed.
Log
Via the Log action, the “Log” popup opens. It lists the backups carried out with ID, Start, End and Status. This allows you to check whether a backup was successful.
Common causes of errors
- The target directory is not specified as an absolute path, or the SFTP user has no write permissions there.
- The password contains disallowed special characters.
- The SFTP server's firewall blocks access from the brainX server.
- The server key has not yet been confirmed (handshake missing).
5. Practical examples
1 – Reports scheduling: Monthly revenue report for management
The managing director should automatically receive the previous month's revenue report as a PDF by email on the 1st of the month. In the Reports module, the corresponding report is configured and the sending time is set to the 1st of the month at 07:00. For the report to be sent at the desired time, the Reports scheduling background task must be active.
2 – Deletion routine: Automatically empty the Recycle Bin after 30 days
Deleted records should not remain permanently in the Recycle Bin. In the Recycle Bin module, the retention period is configured to 30 days. The Deletion routine background task is set to a daily interval (e.g. 02:00 UTC) and activated. From that point on, records that have been in the Recycle Bin for longer than 30 days are automatically and permanently deleted.
3 – Geodata determination: Subsequently determine coordinates after a bulk import
After a CSV import of 500 new organizations with address details, the geodata (coordinates for the map view) should be filled in automatically. The Geodata determination background task is already active and set to Every 5 minutes. Via the Run cronjob now action, the process can be triggered manually without having to wait for the next regular run.
4 – Contract billing: Automatically create monthly invoices
In the brainX APP, subscription contracts are maintained for which an invoice should be created automatically each month. The Billing - Contract billing background task is activated and configured to run daily at 01:00 UTC (02:00 CET or 03:00 CEST). From the next run, brainX automatically creates the corresponding invoices for all due contracts.
6. Frequently asked questions
Can I freely enter the run interval of a background task?
That depends on the respective background task. For most standard tasks, predefined intervals are available to choose from (e.g. every minute, every 5 minutes, hourly, daily). For some tasks, a time for the daily run can additionally be set. This time is given in UTC.
What happens if a background task becomes stuck?
The system automatically notifies the Technology or Support department of brainX GmbH. In the case of in-house installations, the user admin is additionally informed by email, provided a monitoring email is configured. In the list view, the circular arrows icon appears for the affected task, via which the task can be reset and restarted.
Why can't background tasks in the “System” section be edited?
System background tasks are controlled internally by the brainX system and are not intended for manual adjustments. Some of them (e.g. SFTP Backup or Birthday appointments) are automatically activated as soon as the corresponding function is set up or activated.
What does the “Run cronjob now” action do?
This action runs the background task immediately – regardless of the configured interval and the next scheduled run time. It is only available for active background tasks and is useful, for example, to avoid having to wait for the regular run after a bulk import or a configuration change.
Can a background task run multiple times simultaneously?
No. As long as a background task is actively running (the Running since column shows a timestamp), it is not started again – even if the interval elapses in the meantime. Only after the current run has completed is the next run scheduled.