Add the backupPlex script and some documentation in the README to describe its use.

This commit is contained in:
Junior 2025-02-23 17:15:22 +00:00
parent 03e490c017
commit 9c804b37e3
2 changed files with 34 additions and 0 deletions

View File

@ -28,3 +28,17 @@ This is the top level repository folder and contains scripts meant to be used on
### PlexDev/radarr
* __unmonitor.py__ : This program checks each movie in Radarr and sets it to be unmonitored if it already has a downloaded file/movie associated with it. This helps to ensure that Radarr will never seek to automatically replace files.
### Cron Jobs
Here are a couple example entries for cron to run both the `updatecoll.py` and `unmonitor.py` scripts. The full path to where the python scripts are located must be referenced in the crontab entry.
```cron
30 3 * * * /usr/bin/python /home/user/PlexDev/updatecoll.py 1>/dev/null 2>&1
35 3 * * * /usr/bin/python /home/user/PlexDev/radarr/unmonitor.py 1>/dev/null 2>&1
```
### Backup
* __backupPlex__ : This script is designed to be placed in the `/etc/cron.daily` folder. The source (`/var/lib`) and desitination (`/backup` by default) may need to be altered to reflect your local environment.
- The script can be run interactively with a `-v` command line argument. This will display a verbose accounting of what is being backed up. This is particularly useful when running the script for the first time to commit the initial synchronization.

20
backupPlex Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
if ! test -d /backup/plexmediaserver; then
exit 1
fi
args=-a
if [ "$1" = "-v" ]; then
args=-av
fi
systemctl stop plexmediaserver
cd /var/lib
rsync --numeric-ids $args --delete plexmediaserver /backup/
systemctl start plexmediaserver
systemctl stop Tautulli
cd /opt
rsync --numeric-ids $args --delete Tautulli /backup/
systemctl start Tautulli