diff --git a/README.md b/README.md index 513e1ec..6795bf6 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/backupPlex b/backupPlex new file mode 100755 index 0000000..874caf4 --- /dev/null +++ b/backupPlex @@ -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