-
This is a series of scripts that break down the stock processes of a typical Newznab+ installation and perform each task separately and at the same time. Tmux allows for several windows and panes to be created to allow the monitoring of each script as it performs its task. Each task is started by monitor.php. The postprocessing has also been enhanced to allow upto 32 simultaneous postprocesses plus another 8 for each category of releases, for a total of 40 possible postprocessing at once. The scripts are started by either timers, set in defaults.sh or started automatically and then sleeps for a time set in defaults.sh. Almost everything can be stopped/started from the defaults.sh without restarting the scripts.
-
tmux 1.6 or newer is needed to runs these scripts. This script relies on tmux reporting that the "Pane is dead". That is how the script knows that is nothing running in that pane and to restart it for another loop. Seeing "Pane is dead" is normal and expected. If, you are using *bsd or macos, you will need to install gnu sed and set the path to it in defaults.sh.
-
To exit the scripts without any worry of causing problems. Click into the Monitor pane, top left and Ctrl-c, or edit defaults.sh and set running="false". This will stop the monitor script. When all of the other panes show dead, then it is ok to run Ctrl-a c and in new window run killall tmux.
-
These scripts were written and tested on Ubuntu 12.10 where bash is located at /bin/bash. You may need to create a symlink or edit these scripts accordingly.
-
Please backup your database first. Something like this should do it.
mysqldump --opt -u root -p newznab > ~/newznab_backup.sql
-
The first step is to decide whether or not you will convert your database to the InnoDB engine. The InnoDB has a lot of benefits, too many to list here, but more ram is required. How much exactly, depends on too many things to list here.
-
If you decide to convert your database, I recommend using kevin123's github. I recommend only converting the binaries a parts table, using compressed tables. But, there are many choices. I suggest you read his README and follow his recommendations. Or, simply:
cd /var/www/newznab/misc/testing
git clone https://github.com/kevinlekiller/Newznab-Barracuda barracuda
cd barracuda/B\ +\ P/
php bpinnodb_compressed.php
- Now, Clone my github. Theses scripts should be able to run from any path, but this location is where I was asked to put it.
cd /var/www/newznab/misc/update_scripts/nix_scripts/
git clone https://github.com/jonnyboy/newznab-tmux.git tmux
cd tmux
- Edit the paths, timers, username, what to run and then accept.
cp config.sh defaults.sh
nano defaults.sh
- Edit some permissions and a file, run this as root. If, when you run ./start.sh you see 0 nzb's and you are sure there are more than 0 left to import, verify the path to the nzb's in .tmux_user.conf in the conf folder and is created at first run.
cd scripts && ./set_perms.sh
- Run my script, as user. There are many parts that require sudo or root, especially if you have grsec compliled into the kernel. I have put checks in that will require elevated priviledges.
cd ../ && ./start.sh
-
Several commands require root priviledges, such as editing files, chmod the paths, creating the ramdisk. If you have grsec compiled into your kernel, you will also need root priviledges for nmon and any other network monitoring app.
-
Additional scripts included in the script folder. I have included prepare.sh to make updating these scripts a little easier. I also included an svn updater, update_svn.sh. It performs a forced svn update, which overwrites any changes you may have may to the stock nn+ scripts and the updates the database. Also, included is revert.sh. This file removes the changes made to postprocess.sh and you need to run this before running stock update_releases.php.
-
Any variable in defaults.sh can be changed, except the paths to the commands, and the changed will take effect on the next loop of the monitor. By default, the monitor loops every 30 seconds
-
If you connect using putty, then under Window/Translation set Remote character set to UTF-8 and check "Copy and paste line drawing characters". To use 256 colors, you must set Connection/Data Terminal-type string to "xterm-256color" and in Window/Colours check the top three boxes, otherwise only 16 colors are displayed.
-
If you are using the powerline statusbar, you will most likely need a patch font. The Consolas ttf from powerline-fonts is the only one that I have found to be nearly complete and work with putty and Win7. The otf fonts should be fine, although I am not able to test.
-
You must edit any file that is called from misc/testing/ in order for it to actually do something, and update_parsing is good for fixing a few releases everytime it runs, not a silver bullet though.
-
Take caution that Optimize is not running when you shut down the scripts, Optimize runs in window 2, pane 4.
-
Before submitting a bug report, please verify that you are running the current revision of nn+ and these scripts. Then include as much detail as possible.
-
Some scripts written by cj can help cleanup your db and remove unlinked parts. Another script nevermind will help your db run a little faster/easier.
-
I have included a few mysql scripts, mysql-tuning-primer, mysqlreport and mysqltuner.pl to assist in tuning your msql installation. They are locatated in the scripts folder.
-
Join in the converstion at irc://irc.synirc.net/newznab-tmux.
-
Thanks go to all who offered their assistance and improvement to these scripts, especially kevin123, zombu2, epsol, DejaVu, ajeffco, pcmerc, zDefect, shat, evermind, coolcheat, sy, ll, crunch, ixio, AlienX, Solution-X, cryogenx, convict, wicked, McFuzz, pyr2044 and Kragger. If, your nick is missing from this this, PM and I'll fix it quick.
-
These scripts include scripts written by kevin123's, itandrew's, tmux-powerline and thewtex.
* If you find these scripts useful and would like to show your support, please use one of the donation links below. Donations are greatly appreciated. Thank you
![Newznab-tmux](https://raw.github.com/jonnyboy/newznab-tmux/master/images/newznab-tmux.png) ![Newznab-tmux](https://raw.github.com/jonnyboy/newznab-tmux/master/images/newznab-tmux-1.png) ![Newznab-tmux](https://raw.github.com/jonnyboy/newznab-tmux/master/images/newznab-tmux-2.png) ![Newznab-tmux](https://raw.github.com/jonnyboy/newznab-tmux/master/images/newznab-tmux-3.png)