Giter Site home page Giter Site logo

unraid_plex_ssd_backup's Introduction

Overview

This is a script that is meant to backup a dedicated Plex SSD on Unraid. The script creates a tar file out of the "Application Support" directory in the Plex data directory in the plex_library_dir variable. It places the tar file in the backup_dir variable defined at the top of the file. The filename format for the backup file is plex_backup_{date-time}.tar.gz.

How To Use

This script was written for use with the User Scripts plugin. There are two main options for running it.

  1. Copy and paste the script contents into a new user script (method I use)
  2. Clone/download this repository and write a user script to call this one

For either option you will want to edit the following variables at the beginning of the script to suit your needs.

  1. plex_library_dir
  2. backup_dir
  3. num_backups_to_keep

What is the script doing?

The following is teh steps the script goes through to backup Plex.

  1. Plex docker is stopped
  2. Wait for 30 seconds then check if the docker is stopped
  3. If the container is stopped, start the backup
    If not, attempt to stop the constainer up to 5 times
    If that fails, the script exits with status 1 and pushes a warning to the Unraid GUI
  4. Once the backup has finished, start the Plex docker again.
  5. Check if the number of Plex backup files exceeds the specified maximum
  6. If it does, delete the oldest backup file in the backup directory
  7. Push a notification to the Unraid GUI if the script passed or failed

unraid_plex_ssd_backup's People

Contributors

colonelryzen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.