Skip to content

Commit 82a16a4

Browse files
authored
Merge pull request #13 from 007revad/develop
Develop
2 parents 5bd95b4 + ceae14d commit 82a16a4

5 files changed

Lines changed: 29 additions & 17 deletions

File tree

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v1.0.5
2+
- Bug fix for default conf file. Double quotes not needed and cause issue #11
3+
- Updated Restore_Linux_Plex_Backup.sh to handle reading settings from conf file with spaces and no double quotes.
4+
15
v1.0.4
26
- Bug fix for failing to start Plex Media Server. Issue #8
37
- Fixed in Linux_Plex_Backup.sh

Linux_Plex_Backup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck disable=SC2317,SC2181
33
#--------------------------------------------------------------------------
44
# Backup Linux Plex Database to tgz file in Backup folder.
5-
# v1.0.4 02-Jul-2024 007revad
5+
# v1.0.5 09-Nov-2024 007revad
66
#
77
# MUST be run by a user in sudo, sudoers or wheel group, or as root
88
#
@@ -18,7 +18,7 @@
1818
# Script verified at https://www.shellcheck.net/
1919
#--------------------------------------------------------------------------
2020

21-
scriptver="v1.0.4"
21+
scriptver="v1.0.5"
2222
script=Linux_Plex_Backup
2323

2424

@@ -386,6 +386,7 @@ echo "=================================================" |& tee -a "${Log_File}"
386386
# Start Plex Media Server
387387

388388
echo "Starting Plex..." |& tee -a "${Log_File}"
389+
#/usr/lib/plexmediaserver/Resources/start.sh
389390
systemctl start plexmediaserver
390391

391392

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,21 @@ If you run multiple backups on the same day the time will be included in the fil
5151
You need to set **backupDirectory=** near the top of the script (below the header). Set it to the location where you want the backup saved to.
5252

5353
```YAML
54-
backupDirectory="/share/Backups/Plex_Backups"
54+
Backup_Directory=/share/Backups/Plex_Backups
55+
```
56+
or
57+
```YAML
58+
Backup_Directory=/share/folder with spaces/Plex_Backups
5559
```
5660

5761
The script gets the disto and hostname from the NAS to use logs and backup name.
58-
Set Name= to "distro", "hostname" or some nickname. If Name= is blank the Linux computer's hostname will be used.
62+
Set Name= to distro, hostname or you can set a 'nickname'. If Name= is blank the Linux computer's hostname will be used.
5963

60-
The LogAll setting enables, or disables, logging every file that gets backed up. Set LogAll= to "yes" or "no". Blank is the same as no.
64+
The LogAll setting enables, or disables, logging every file that gets backed up. Set LogAll= to yes or no. Blank is the same as no.
6165

6266
```YAML
63-
Name="distro"
64-
LogAll="no"
67+
Name=distro
68+
LogAll=no
6569
```
6670

6771
### Requirements

Restore_Linux_Plex_Backup.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck disable=SC2317,SC2181
33
#--------------------------------------------------------------------------
44
# Companion script for Linux Plex Backup script.
5-
# v1.0.4 02-Jul-2024 007revad
5+
# v1.0.5 09-Nov-2024 007revad
66
#
77
# MUST be run by a user in sudo, sudoers or wheel group, or as root
88
#
@@ -14,7 +14,7 @@
1414
# Script verified at https://www.shellcheck.net/
1515
#--------------------------------------------------------------------------
1616

17-
scriptver="v1.0.4"
17+
scriptver="v1.0.5"
1818
script=Restore_Linux_Plex_Backup
1919

2020

@@ -23,8 +23,10 @@ Backup_Directory=""
2323
Name=""
2424
LogAll=""
2525
if [[ -f $(dirname -- "$0";)/backup_linux_plex.config ]];then
26-
# shellcheck disable=SC1091
27-
source "$(dirname -- "$0";)"/backup_linux_plex.config
26+
# shellcheck disable=SC1090,SC1091
27+
while read -r var; do
28+
if [[ $var =~ ^[a-zA-Z0-9_]+=.* ]]; then export "$var"; fi
29+
done < "$(dirname -- "$0";)"/backup_linux_plex.config
2830
else
2931
echo "backup_linux_plex.config file missing!"
3032
exit 1
@@ -346,6 +348,7 @@ echo "=================================================" |& tee -a "${Log_File}"
346348
# Start Plex Media Server
347349

348350
echo "Starting Plex..." |& tee -a "${Log_File}"
351+
#/usr/lib/plexmediaserver/Resources/start.sh
349352
systemctl start plexmediaserver
350353

351354

backup_linux_plex.config

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
#-------------------------------------------------------------------------
66

77
# Set location to save tgz file to
8-
Backup_Directory="/share/Backups/Plex_Backup"
8+
Backup_Directory=/share/Backups/Plex_Backup
99

1010
# The script gets the distro and hostname for logging and the backup file name.
11-
# Set Name= to "distro", "hostname" or some nickname.
12-
# If Name= is blank the Asustor's hostname will be used.
13-
Name="distro"
11+
# Set Name= to distro, hostname or set it to a 'nickname'.
12+
# If Name= is blank the computer's hostname will be used.
13+
Name=distro
1414

1515
# Log all files backed up.
16-
# Set LogAll= to "yes" or "no". Blank is the same as no.
17-
LogAll="no"
16+
# Set LogAll= to yes or no. Blank is the same as no.
17+
LogAll=no
1818

0 commit comments

Comments
 (0)