Get All Scheduled Tasks
There are several tasks that can run on a schedule on the Plex server. Tasks such as backing up and optimizing a database, or refreshing the metadata for the libraries are just some examples of tasks that can be run.
This API command will lists all the available tasks that can run on the Plex server, whether the tasks are enabled or not enabled to run.
URL
GET http://{ip_address}:32400/butler?X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
ip_address | The IP address of the Plex Media server. |
plex_token | The Plex token. |
Return Status
HTTP Code | Description |
---|---|
200 | Success - The request was successful. |
401 | Unauthorized - The Plex token provided was not valid. |
Response
An XML string value that lists all the available tasks on the server. An example of the XML returned from the request is shown below:
<?xml version="1.0" encoding="UTF-8"?> <ButlerTasks> <ButlerTask name="AutomaticUpdates" interval="1" scheduleRandomized="0" enabled="0" /> <ButlerTask name="BackupDatabase" interval="3" scheduleRandomized="0" enabled="1" title="Backup Database" description="Create a backup copy of the server's database in the configured backup directory" /> <ButlerTask name="ButlerTaskGenerateAdMarkers" interval="1" scheduleRandomized="0" enabled="0" /> <ButlerTask name="ButlerTaskGenerateCreditsMarkers" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="ButlerTaskGenerateIntroMarkers" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="CleanOldBundles" interval="7" scheduleRandomized="0" enabled="1" /> <ButlerTask name="CleanOldCacheFiles" interval="7" scheduleRandomized="0" enabled="1" /> <ButlerTask name="DeepMediaAnalysis" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="GarbageCollectBlobs" interval="7" scheduleRandomized="0" enabled="1" /> <ButlerTask name="GarbageCollectLibraryMedia" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="GenerateAutoTags" interval="1" scheduleRandomized="0" enabled="0" /> <ButlerTask name="GenerateBlurHashes" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="GenerateChapterThumbs" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="GenerateMediaIndexFiles" interval="1" scheduleRandomized="0" enabled="0" /> <ButlerTask name="LoudnessAnalysis" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="MusicAnalysis" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="OptimizeDatabase" interval="7" scheduleRandomized="0" enabled="1" /> <ButlerTask name="RefreshEpgGuides" interval="1" scheduleRandomized="1" enabled="1" /> <ButlerTask name="RefreshLibraries" interval="1" scheduleRandomized="0" enabled="1" /> <ButlerTask name="RefreshLocalMedia" interval="3" scheduleRandomized="0" enabled="1" /> <ButlerTask name="RefreshPeriodicMetadata" interval="1" scheduleRandomized="1" enabled="1" /> <ButlerTask name="ReverseGeocode" interval="1" scheduleRandomized="1" enabled="0" /> <ButlerTask name="UpgradeMediaAnalysis" interval="1" scheduleRandomized="0" enabled="1" /> </ButlerTasks>
The XML returned provides a list of the all the tasks that can run on a Plex server. Unlike many of the other API commands, this command does not return a MediaContainer
element. Instead, it returns a root ButlerTasks
element, and within that multiple ButlerTask
elements.
Each ButlerTask
element represents one task that can be run on the server.
Attribute | Description |
---|---|
name | The name of the task. |
interval | The time interval for the task execution. |
scheduleRandomized | Flag indicating the schedule for the task is random. 0 - the schedule is not random, 1 - the schedule is random. |
enabled | Flag indicating if the scheduled task is enabled. 0 - the scheduled task is not enabled, 1 - the scheduled task is enabled. |
title | The title of the scheduled task. |
description | A description of the task. |
The title
and description
attributes may not be available for all tasks.
Examples
curl -X GET http://{ip_address}:32400/butler?X-Plex-Token={plex_token}
import requests plex_url = http://{ip_address}:32400/butler?X-Plex-Token={plex_token} response = requests.get(plex_url) print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/butler?X-Plex-Token={plex_token}' -Method 'GET' Write-Output $response