-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbackup-plex-db
executable file
·32 lines (27 loc) · 1.02 KB
/
backup-plex-db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# This backup program will use HashBackup to upload the entire
# contents of my Plex database to my encrypted remotes.
# It will send a notification that the backup is starting
# before it is run. The hashbackup command will output the log
# into a file.
# Create constants
PUSH_NOTIFICATION_DIRECTORY="/share/Web/bin/push_notifications/backups"
# Create a string like `2018-02-19_14:16:51`
datename="$(date '+%Y-%m-%d_%H:%M:%S')"
logfile="/share/Web/rclone/logs/$datename.plex-db.log"
# Send a starting notification
$PUSH_NOTIFICATION_DIRECTORY/push \
"Backup started" \
"Started backing up the Plex database.";
# Backup the Plex database. HashBackup will automatically
# post the backup files to my Google Drive accounts, as
# well as keeping a local copy on my Drobo
/share/Web/bin/hb \
log \
backup \
-c /share/Backups/plex/db \
/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer/Library
# Send a notification the backup finished
$PUSH_NOTIFICATION_DIRECTORY/push \
"Backup finished" \
"Finished backing up the Plex database.";