mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 06:40:13 -08:00
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:
83
plex/plex-management.md
Normal file
83
plex/plex-management.md
Normal 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.
|
||||
Reference in New Issue
Block a user