Maintenance Tasks ================= ## Maintenance Task Classification | Category | |------------------------------------------| | Feature | | Consistency and other Reports | | Consistency Repair and Manual Migrations | | Relevancy | |------------| | Default | | Relevant | | Rare | | Deprecated | ## Introduction A maintenance task is a process which runs once or in regular time intervals. It is defined by a [core plugin](../../software-developer-documentation/server-side-extensions/core-plugins.md#core-plugins) of type `maintenance-tasks`. Usually a maintenance task can only run on AS or DSS but not in both environments. The following properties are common for all maintenance tasks: |Property Key|Description| |--- |--- | |class|The fully-qualified Java class name of the maintenance task. The class has to implement IMaintenanceTask.| |execute-only-once|A flag which has to be set to true if the task should be executed only once. Default value: false| |interval|A time interval (in seconds) which defines the pace of execution of the maintenance task. Can be specified with one of the following time units: ms, msec, s, sec, m, min, h, hours, d, days. Default time unit is sec. Default value: one day.| |start|A time at which the task should be executed the first time. Format: HH:mm. where HH is a two-digit hour (in 24h notation) and mm is a two-digit minute. By default the task is execute at server startup.| |run-schedule|Scheduling plan for task execution. Properties execute-only-once, interval, and start will be ignored if specified.

**Crontab syntax:**

`cron: `

Examples:

`cron: 0 0 * * * *`: the top of every hour of every day.

`cron: */10 * * * * *`: every ten seconds.

`cron: 0 0 8-10 * * *`: 8, 9 and 10 o'clock of every day.

`cron: 0 0 6,19 * * *`: 6:00 AM and 7:00 PM every day.

`cron: 0 0/30 8-10 * * *`: 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.

`cron: 0 0 9-17 * * MON-FRI`: on the hour nine-to-five weekdays.

`cron: 0 0 0 25 12 ?`: every Christmas Day at midnight.

**Non-crontab syntax:**

Comma-separated list of definitions with following syntax:

`[[.]] [[.]] [:]`

where `` counts the specified week day of the month. `` is `MO`, `MON`, `TU`, `TUE`, `WE`, `WED`, `TH`, `THU`, `FR`, `FRI`, `SA`, `SAT`, `SU`, or `SUN` (ignoring case). `` is either the month number (followed by an optionl '.') or `JAN`, `FEB`, `MAR`, `APR`, `MAY`, `JUN`, `JUL`, `AUG`, `SEP`, `OCT`, `NOV`, or `DEC` (ignoring case).

Examples:

`6, 18`: every day at 6 AM and 6 PM.

`3.FR 22:15`: every third friday of a month at 22:15.

`1. 15:50`: every first day of a month at 3:50 PM.

`SAT 1:30`: every saturday at 1:30 AM.

`1.Jan 5:15, 1.4. 5:15, 1.7 5:15, 1. OCT 5:15`: every first day of a quarter at 5:15 AM.| |run-schedule-file|File where the timestamp for next execution is stored. It is used if run-schedule is specified. Default: `/_` | |retry-intervals-after-failure|Optional comma-separated list of time intervals (format as for interval) after which a failed execution will be retried. Note, that a maintenance task will be execute always when the next scheduled timepoint occurs. This feature allows to execute a task much earlier in case of temporary errors (e.g. temporary unavailibity of another server).| ## Feature ### ArchivingByRequestTask **Environment**: AS **Relevancy:** Relevant **Description**: Triggers archiving for data sets where the 'requested archiving' flag is set. Waits with archiving until enough data sets for a group come together. This is necessary for taped-base archiving where the files to be stored have to be larger than a minimum size. **Configuration**: |Property Key|Description| |--- |--- | |keep-in-store|If true the archived data set will not be removed from the store. That is, only a backup will be created. Default: false| |minimum-container-size-in-bytes|Minimum size of an archive container which has one or more data set. This is important for Multi Data Set Archiving. Default: 10 GB| |maximum-container-size-in-bytes|Maximum size of an archive container which has one or more data set. This is important for Multi Data Set Archiving. Default: 80 GB| |configuration-file-path|Path to the configuration file as used by User Group Management. Here only the group keys are needed. They define a set of groups. If there is no configuration file at the specified path this set is empty.A data set requested for archiving belongs the a specified group if its space starts with the group key followed by an underscore character '_'. Otherwise it belongs to no group. This maintenance task triggers archiving an archive container with one or more data set from the same group if the container fits the specified minimum and maximum size. Note, that data sets which do not belong to a group are handled as a group too. If a data set is larger than the maximum container size it will be archived even though the container is to large. The group key (in lower case) is provided to the archiver. The Multi Data Set Archiver will use this for storing the archive container in a sub folder of the same name.


Default: `etc/user-management-maintenance-config.json` | **Example**: **plugin.properties** ``` class = ch.systemsx.cisd.openbis.generic.server.task.ArchivingByRequestTask interval = 1 d minimum-container-size-in-bytes = 20000000000 maximum-container-size-in-bytes = 200000000000 configuration-file-path = ../../../data/groups.json ``` **Notes:**  In practice every instance using multi dataset archiving feature and also the ELN-LIMS should have this enabled. ### AutoArchiverTask  **Environment**: DSS **Relevancy:** Rare **Description**: Triggers archiving of data sets that have not been archived yet. **Configuration**: |Property Key|Description| |--- |--- | |remove-datasets-from-store|If true the archived data set will be removed from the store. Default: false| |data-set-type|Data set type of the data sets to be archived. If undefined all data set of all types might be archived.| |older-than|Minimum number of days a data set to be archived hasn't been accessed. Default: 30| |archive-candidate-discoverer.class|Discoverer of candidates to be archived:
  • `ch.systemsx.cisd.etlserver.plugins.AgeArchiveCandidateDiscoverer`: All data sets with an access time stamp older than specified by property older-than are candidates. This is the default discoverer.
  • `ch.systemsx.cisd.etlserver.plugins.TagArchiveCandidateDiscoverer`: All data sets which are marked by one of the tags specified by the property `archive-candidate-discoverer.tags` are candidates.
| |policy.class|A policy specifies which data set candidates should be archived. If undefined all candidates will be archived. Has to be a fully-qualified name of a Java class implementing ch.systemsx.cisd.etlserver.IAutoArchiverPolicy.| |policy.*|Properties specific for the policy specified by `policy.class`. More about policies can be found here.| **Example**: **plugin.properties** ``` class = ch.systemsx.cisd.etlserver.plugins.AutoArchiverTask interval = 10 days archive-candidate-discoverer.class = ch.systemsx.cisd.etlserver.plugins.TagArchiveCandidateDiscoverer archive-candidate-discoverer.tags = /admin-user/archive policy.class = ch.systemsx.cisd.etlserver.plugins.GroupingPolicy policy.minimal-archive-size = 1500000 policy.maximal-archive-size = 3000000 policy.grouping-keys = Space#DataSetType, Space#Experiment:merge ``` ### BlastDatabaseCreationMaintenanceTask  **Environment**: DSS **Relevancy:** Default (ELN-LIMS) **Description**: Creates BLAST databases from FASTA and FASTQ files of data sets and/or properties of experiments, samples, and data sets. The title of all entries of the FASTA and FASTQ files will be extended by the string `[Data set: , File: ]`. Sequences provide by an entity property will have identifiers of the form `+++