Add comprehensive Plex backup management scripts

- Introduced `restore-plex.sh` for restoring Plex backups with logging and validation.
- Created `test-plex-backup.sh` for automated testing of backup functionalities.
- Developed `validate-plex-backups.sh` for validating backup integrity and monitoring.
- Updated `update.sh` to reference the correct path for Plex service management.
This commit is contained in:
Peter Wood
2025-05-26 13:20:12 -04:00
parent a91fc79449
commit c9b69ea789
30 changed files with 702 additions and 25 deletions

83
plex/plex-management.md Normal file
View File

@@ -0,0 +1,83 @@
# Plex Management Script Documentation
This document provides an overview and step-by-step explanation of the `plex.sh` script. This script is used to manage the Plex Media Server service on a systemd-based Linux distribution.
## Script Overview
The script performs the following main tasks:
1. Starts the Plex Media Server.
2. Stops the Plex Media Server.
3. Restarts the Plex Media Server.
4. Displays the current status of the Plex Media Server.
## Detailed Steps
### 1. Start Plex Media Server
```bash
start_plex() {
sudo systemctl start plexmediaserver
echo "Plex Media Server started."
}
```
This function starts the Plex Media Server using `systemctl`.
### 2. Stop Plex Media Server
```bash
stop_plex() {
sudo systemctl stop plexmediaserver
echo "Plex Media Server stopped."
}
```
This function stops the Plex Media Server using `systemctl`.
### 3. Restart Plex Media Server
```bash
restart_plex() {
sudo systemctl restart plexmediaserver
echo "Plex Media Server restarted."
}
```
This function restarts the Plex Media Server using `systemctl`.
### 4. Display Plex Media Server Status
```bash
status_plex() {
sudo systemctl status plexmediaserver
}
```
This function displays the current status of the Plex Media Server using `systemctl`.
## Usage
To use the script, run it with one of the following parameters:
```shell
./plex.sh {start|stop|restart|status}
```
- `start`: Starts the Plex Media Server.
- `stop`: Stops the Plex Media Server.
- `restart`: Restarts the Plex Media Server.
- `status`: Displays the current status of the Plex Media Server.
## Important Information
- Ensure that the script is executable. You can make it executable with the following command:
```shell
chmod +x plex.sh
```
- The script uses `systemctl` to manage the Plex Media Server service. Ensure that `systemctl` is available on your system.
- The script requires `sudo` privileges to manage the Plex Media Server service. Ensure that you have the necessary permissions to run the script with `sudo`.
By following this documentation, you should be able to understand and use the `plex.sh` script effectively.