EDIT: 15/05/2017 [Added detailed steps to follow the procedure from the begining running QTS 4.3.3 and an important note for users that followed this HOW TO in QTS 4.2 and have upgraded to QTS 4.3.3]
I would like to share with you what I´ve made in my NAS TS-453Pro in order to run the script PlexEmail (actually in version 0.8.7) creating the Web page and sending the e-mails to the rest of my Plex server users. You can take a look to the official PlexEmail thread in the plex forums here:
https://forums.plex.tv/discussion/15161 ... d-media/p1
And also in your GitHub page here:
https://github.com/jakewaldron/PlexEmail
Pre-Requisites [Until QTS 4.2.5]IMPORTANT NOTE: TO ALL USERS THAT FOLLOWED THIS HOW-TO IN QTS 4.2 OR EARLIER AND PERFORMED THE UPGRADE TO QTS 4.3.3:
It´s important to know that the package Qpython2 have changed from the firmware QTS 4.3.3 so, if you installed it previously in QTS 4.2 or earlier version, and you did the upgrade to QTS 4.3.3 you have to uninstall it first and install it again. If you upgraded the package Qpython2 directly from the repo or overwriting it with a new version from the forum will not work. This is because the paths has changed. This is advised in the first post where you have the download of the new QPython2 for the x64 version.x64 Version : http://www.positiv-it.fr/QNAP/APP/QPyth ... 4.qpkg.zip [ FW 4.3 ] [ Previous Version need to be removed as prior ]
- You must install:
[QPython2 ] [ 2.7.11.0.1 ] Python 2 + modules from the QNAP forum: viewtopic.php?f=217&t=109899 or from the repo: http://store.qnapclub.eu/
- In addition it´s recommended install (if you didn´t installed previously) Git 2.1.0 Optware Free from the QNAP´s forum also: viewtopic.php?f=301&t=97220 otherwise you can avoid using git also if you download from github page the files with the option "clone or download" and transferring the files in the paths/folders indicated below.
- You must install:
[QPython2 ] [ 2.7.13.0 ] Python 2 + modules from the QNAP forum: viewtopic.php?f=217&t=109899 or from the repo: http://store.qnapclub.eu/
- In addition it´s recommended install (if you didn´t installed previously):
[ QGit ] [ 2.10.0 ] Git SCM (Full) from the QNAP´s forum or from therepo.
[CACert ] [ 1.00 ] Certificate Authority Certificates from the QNAP´s forum or from therepo. Needed to avoid certificate verify problems this also needs QPerl package as dependency
[ QPerl ] [ 5.20.2.1 ] Perl / CPAN from the QNAP´s forum or from therepo.
Due that we have 2 packages more to use Qgit I´ve added a new way to download the files directly from the command line without need to install these packages. Just only QPython must be installed.
Code: Select all
wget https://github.com/jakewaldron/PlexEmail/archive/master.zip
unzip master.zip
Installation [Until QTS 4.2.5]
SSH to the NAS
Code: Select all
cd /share/CACHEDEV1_DATA/.qpkg
git clone https://github.com/jakewaldron/PlexEmail.git
mkdir /share/CACHEDEV1_DATA/Web/plexemail
cp -R /share/CACHEDEV1_DATA/.qpkg/PlexEmail/web/* /share/CACHEDEV1_DATA/Web/plexemail/
SSH to the NAS
Code: Select all
wget https://github.com/jakewaldron/PlexEmail/archive/master.zip
unzip master.zip
mkdir /share/CACHEDEV1_DATA/.qpkg/PlexEmail/
cp -R /root/PlexEmail-master/* /share/CACHEDEV1_DATA/.qpkg/PlexEmail/
mkdir /share/CACHEDEV1_DATA/Web/plexemail
cp -R /root/PlexEmail-master/web/* /share/CACHEDEV1_DATA/Web/plexemail/
Code: Select all
vi /share/CACHEDEV1_DATA/.qpkg/PlexEmail/scripts/config.conf
Running the script [Until QTS 4.2.5]plex_data_folder = '/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/'
web_folder = '/share/Web/'
Code: Select all
/opt/QPython2/bin/python2 /share/CACHEDEV1_DATA/.qpkg/PlexEmail/scripts/plexEmail.py
Code: Select all
/share/CACHEDEV1_DATA/.qpkg/QPython2/bin/python /share/CACHEDEV1_DATA/.qpkg/PlexEmail/scripts/plexEmail.py
Code: Select all
Web page created successfully
Successfully sent 1 email(s)
This an example of an entry that will create a new job in crontab to execute the script at 16:00H. every friday.
Code: Select all
echo "0 16 * * 5 /opt/QPython2/bin/python2 /share/CACHEDEV1_DATA/.qpkg/PlexEmail/scripts/plexEmail.py" >> /etc/config/crontab
crontab /etc/config/crontab
This an example of an entry that will create a new job in crontab to execute the script at 16:00H. every friday.
Code: Select all
echo "0 16 * * 5 /share/CACHEDEV1_DATA/.qpkg/QPython2/bin/python /share/CACHEDEV1_DATA/.qpkg/PlexEmail/scripts/plexEmail.py" >> /etc/config/crontab
crontab /etc/config/crontab
And that´s all!
Hope this how to can be useful.
Best regards.