| Hourly | Update only when the script is run in that hour | hourly(Hour of Day) | `hourly(17)` |
| Daily | Update once a day | daily | `daily` |
| Weekly | Update once a week on the specified day | weekly(Day of Week) | `weekly(sunday)` |
| Monthly | Update once a month on the specified day | monthly(Day of Month) | `monthly(1)` |
| Yearly | Update once a year on the specified day | yearly(MM/DD) | `yearly(01/30)` |
| Range | Updates whenever the date is within the range | range(MM/DD-MM/DD) | `range(12/01-12/31)` |
| Never | Never updates | never | `never` |
| Non Existing | Updates if it doesn't exist | non_existing | `non_existing` |
| All | Requires that all comma separated scheduling options inside its brackets be meet in order to run | all[Options] | `all[weekly(sunday), hourly(17)]` |
* `daily` is the default when `schedule` is not specified.
* You can run the script multiple times per day but using the `--time` command line argument detailed on the [Run Commands & Environmental Variables Page](../../home/environmental.md#time-to-run).
* You can have multiple scheduling options as a list.
* You can use the `delete_not_scheduled` setting to delete Collections that are skipped due to not being scheduled.
## Examples
Below is an example of a library which has been scheduled to run every Sunday. This will schedule everything within the library (in this case Metadata files and Operations) for the same day.
Below is an example of a scheduled library:
```yaml
```yaml
libraries:
libraries:
@ -18,9 +42,9 @@ libraries:
mass_critic_rating_update: tmdb
mass_critic_rating_update: tmdb
```
```
Below is an example of scheduling Metadata Files, Playlist Files, and Overlay Files:
Metadata Files, Playlist Files, and Overlay Files can all be individually scheduled, as seen below where different files are scheduled to run on each day of the week:
**Note: Overlay Files cannot be individually Scheduled.**
**Note: Overlay Files cannot be individually Scheduled, all Overlay Files must be scheduled for the same period.**
```yaml
```yaml
libraries:
libraries:
@ -30,7 +54,7 @@ libraries:
schedule: weekly(monday)
schedule: weekly(monday)
- pmm: imdb
- pmm: imdb
schedule: weekly(tuesday)
schedule: weekly(tuesday)
- pmm: studio
- folder: config/Movies/
schedule: weekly(wednesday)
schedule: weekly(wednesday)
- pmm: genre
- pmm: genre
schedule: weekly(thursday)
schedule: weekly(thursday)
@ -44,11 +68,9 @@ libraries:
playlist_files:
playlist_files:
- file: config/Playlists.yml
- file: config/Playlists.yml
schedule: weekly(sunday)
schedule: weekly(sunday)
- file: config/Playlists2.yml
schedule: weekly(monday)
```
```
Below is an example of a scheduled collection:
Below is an example of a collection which has been scheduled to run on a Sunday. In this scenario, if you run PMM on a Monday, this collection will be skipped but any other collections which do not have a scheduled defined will be run.
```yaml
```yaml
collections:
collections:
@ -64,7 +86,7 @@ collections:
- monthly(15)
- monthly(15)
```
```
Below is an example of a scheduled pinning collection:
You can also schedule items to be "pinned" to your homescreen on a schedule. For example, this collection will be pinned to your homescreen for the month of December and on January 1st will no longer be pinned (you must run PMM on 1st January for the removal of the pin to happen)
```yaml
```yaml
collections:
collections:
@ -74,21 +96,25 @@ collections:
visible_home: range(12/01-12/31)
visible_home: range(12/01-12/31)
```
```
The scheduling options are:
Whilst it isn't possible to schedule individual Operations, you can create additional placeholder library names and point them to the original library using `library_name`. This can be used to achieve individually scheduled operations, as seen below:
| Hourly | Update only when the script is run in that hour | hourly(Hour of Day) | `hourly(17)` |
metadata_path:
| Daily | Update once a day | daily | `daily` |
- file: config/Movies.yml
| Weekly | Update once a week on the specified day | weekly(Day of Week) | `weekly(sunday)` |
Movies Operations (Monday): # Name doesn't matter
| Monthly | Update once a month on the specified day | monthly(Day of Month) | `monthly(1)` |
library_name: Movies # Must match your library name in Plex
| Yearly | Update once a year on the specified day | yearly(MM/DD) | `yearly(01/30)` |
schedule: weekly(monday)
| Range | Updates whenever the date is within the range | range(MM/DD-MM/DD) | `range(12/01-12/31)` |
operations:
| Never | Never updates | never | `never` |
mass_user_rating_update: imdb
| Non Existing | Updates if it doesn't exist | non_existing | `non_existing` |
Movies Operations (Wednesday): # Name doesn't matter
| All | Requires that all comma separated scheduling options inside its brackets be meet in order to run | all[Options] | `all[weekly(sunday), hourly(17)]` |
library_name: Movies # Must match your library name in Plex
schedule: weekly(wednesday)
* `daily` is the default when `schedule` is not specified.
operations:
* You can run the script multiple times per day but using the `--time` command line argument detailed on the [Run Commands & Environmental Variables Page](../../home/environmental.md#time-to-run).
mass_audience_rating_update: tmdb
* You can have multiple scheduling options as a list.
Movies Operations (Friday): # Name doesn't matter
* You can use the `delete_not_scheduled` setting to delete Collections that are skipped due to not being scheduled.
library_name: Movies # Must match your library name in Plex