mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 02:01:33 +00:00
added option to use second nntp provider, added script to reset/truncate when changeing providers
it is not necessary to run reset_truncate.php in order to second nntp provider for postprocessing only
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__).'/../../../../../www/config.php');
|
||||
require(dirname(__FILE__)."/../../../../../www/config.php");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ movie.php
|
||||
music1.php
|
||||
music.php
|
||||
nfo.php
|
||||
|
||||
nntp2.php
|
||||
|
||||
+20
-19
@@ -2,7 +2,7 @@
|
||||
|
||||
require(dirname(__FILE__)."/config.php");
|
||||
require(WWW_DIR.'/lib/postprocess.php');
|
||||
$version="0.1r771";
|
||||
$version="0.1r772";
|
||||
|
||||
$db = new DB();
|
||||
|
||||
@@ -1050,20 +1050,20 @@ while( $i > 0 )
|
||||
}
|
||||
|
||||
//start postprocessing in window 2
|
||||
$post = $array['POST_TO_RUN'];
|
||||
$post = $array['POST_TO_RUN_A'];
|
||||
for ($g=1; $g<=16; $g++)
|
||||
{
|
||||
$h=$g-1;
|
||||
$f=$h*100;
|
||||
$j=$g*2;
|
||||
$f=$h*200;
|
||||
$j=$g*1;
|
||||
$color = get_color();
|
||||
$log = writelog($panes2[$h]);
|
||||
if (( $array['MAX_LOAD'] >= get_load()) && ( $array['POST_TO_RUN'] >= $g ) && ( $work_remaining_now > $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes2[$h] $ds2 && cd $_bin && sleep $j && $_php processAdditional$g.php 2>&1 $log && echo \" \033[1;0;33m\" && $ds1 $panes2[$h] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['POST_TO_RUN'] >= $g ) && ( $work_remaining_now <= $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
if (( $array['MAX_LOAD'] >= get_load()) && ( $array['POST_TO_RUN_A'] >= $g ) && ( $work_remaining_now > $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes2[$h] $ds2 && cd $_bin && $_php processAdditional$g.php 2>&1 $log && echo \" \033[1;0;33m\" && $ds1 $panes2[$h] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['POST_TO_RUN_A'] >= $g ) && ( $work_remaining_now <= $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h] $work_remaining_now < $f\nHas no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $g > $post ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h] Disabled by POST_TO_RUN_A\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $optimize_safe_to_run != "true" ) && ( $array['MAX_LOAD'] <= get_load())) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h] Disabled by MAX_LOAD\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
@@ -1072,20 +1072,21 @@ while( $i > 0 )
|
||||
}
|
||||
|
||||
//start postprocessing in window 2
|
||||
$post = $array['POST_TO_RUN'];
|
||||
for ($g=17; $g<=32; $g++)
|
||||
{
|
||||
$h=$g-17;
|
||||
$f=($g-1)*100;
|
||||
$j=$g*2;
|
||||
$color = get_color();
|
||||
$post = $array['POST_TO_RUN_B'];
|
||||
for ($g=1; $g<=16; $g++)
|
||||
{
|
||||
$k=$g+16;
|
||||
$h=$g-1;
|
||||
$f=$h*200;
|
||||
$j=$g*1;
|
||||
$color = get_color();
|
||||
$log = writelog($panes2[$h]);
|
||||
if (( $array['MAX_LOAD'] >= get_load()) && ( $array['POST_TO_RUN'] >= $g ) && ( $work_remaining_now > $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.$h 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[$h] $ds2 && cd $_bin && sleep $j && $_php processAdditional$g.php 2>&1 $log && echo \" \033[1;0;33m\" && $ds1 $panes3[$h] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['POST_TO_RUN'] >= $g ) && ( $work_remaining_now <= $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
if (( $array['MAX_LOAD'] >= get_load()) && ( $array['POST_TO_RUN_B'] >= $g ) && ( $work_remaining_now > $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.$h 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[$h] $ds2 && cd $_bin && $_php processAdditional$k.php 2>&1 $log && echo \" \033[1;0;33m\" && $ds1 $panes3[$h] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['POST_TO_RUN_B'] >= $g ) && ( $work_remaining_now <= $f ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.$h 'echo \"\033[38;5;\"$color\"m\n$panes3[$h]\n$work_remaining_now < $f\nHas no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $g > $post ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.$h 'echo \"\033[38;5;\"$color\"m\n$panes3[$h]\nDisabled by \nPOST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.$h 'echo \"\033[38;5;\"$color\"m\n$panes3[$h]\nDisabled by \nPOST_TO_RUN_B\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $optimize_safe_to_run != "true" ) && ( $array['MAX_LOAD'] <= get_load())) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.$h 'echo \"\033[38;5;\"$color\"m\n$panes3[$h] Disabled by MAX_LOAD\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
|
||||
+409
-186
File diff suppressed because it is too large
Load Diff
+26
-10
@@ -39,13 +39,29 @@ export ADMIN_PATH=$NEWZPATH"/www/admin"
|
||||
############################################################
|
||||
|
||||
#Post Processing Additional is the post processing that downloads rar files and attempts to get info for your site
|
||||
#you are able to set the number of process to be run from 1-32, remember that each process uses 1 of your nntp connections
|
||||
#so, if you have 20, and you set this to 32, you will have errors, lots of errors, nfo lookup uses 1 -3 connections
|
||||
#you are able to set the number of processes to be run from 1-32, remember that each process uses 1 of your nntp connections
|
||||
#so, if you have 20, and you set this to 32, you will have errors, lots of errors, nfo lookup uses 1-3 connections each
|
||||
#binaries and backfill threaded default up to 10 connections each and predb uses 1, so understand how many connections you are using when setting
|
||||
#trial and error for this, set to 1 will run > 0, set to 2 will run > 200, 3 will run > 300 and so on.
|
||||
#trial and error for this, set to 1 will run > 0, set to 2 will run > 100, 3 will run > 200 and so on.
|
||||
#At some point, increasing this begins to slow things down. It will need to be adjusted for your system
|
||||
#to get the desired performance, 0 will disable all post processing
|
||||
export POST_TO_RUN="14"
|
||||
#to get the desired performance, 0 will disable all post processing, but not category processing
|
||||
#the first window has up to 16 postprocess and can use primary or alternate NNTP provider
|
||||
export POST_TO_RUN_A="8"
|
||||
|
||||
#The second window also has 16 processes and can use promary or alternate NNTP provider
|
||||
export POST_TO_RUN_B="16"
|
||||
|
||||
#by modifying www/config.php like http://pastebin.com/VgH9DCZw, you can use 1 provider to run update_binaries
|
||||
#and backup and another provider to run post processing with. Or, 1 provider to run up to 16 postprocesses and another to run
|
||||
#up to 16 more postprocesses, or the same provider for everything
|
||||
#you can not switch providers without resetting all groups and truncating, I have included a script in scripts folders to reset and truncate
|
||||
#sudo scripts/reset_truncate.php
|
||||
|
||||
#this one sets 1 provider for everything(false), or first provider for update_binaries and backfill and another for postprocessing(true)
|
||||
export USE_TWO_NNTP="true"
|
||||
|
||||
#this allows you split the 32 postprocessing into 2 separate providers
|
||||
export USE_TWO_PP="true"
|
||||
|
||||
############################################################
|
||||
|
||||
@@ -115,7 +131,7 @@ export BACKFILL_SEQ_TIMER="10"
|
||||
############################################################
|
||||
|
||||
#Choose to run update_binaries true/false
|
||||
export BINARIES="true"
|
||||
export BINARIES="truef"
|
||||
|
||||
#Choose to run the threaded or non-threaded newznab binaries scripts true/false
|
||||
#update_binaries.php or update_binaries_threaded.php
|
||||
@@ -142,7 +158,7 @@ export BINARIES_MAX_ROWS="0"
|
||||
############################################################
|
||||
|
||||
#Choose to run backfill script true/false
|
||||
export BACKFILL="true"
|
||||
export BACKFILL="trued"
|
||||
|
||||
#Choose to run the threaded or non-threaded newznab backfill scripts true/false
|
||||
#backfill.php or backfill_threaded.php
|
||||
@@ -201,7 +217,7 @@ export KEVIN_PARTS="100000"
|
||||
export NZBS="/home/jonnyboy/nzb_files2"
|
||||
|
||||
#Choose to run import nzb script true/false
|
||||
export IMPORT="trued"
|
||||
export IMPORT="truef"
|
||||
|
||||
#If, you have all of your nzbs in one folder select false
|
||||
#If, you have all of you nzbs split into separate in with the root at $NZBS then select true
|
||||
@@ -214,11 +230,11 @@ export NZB_THREADS="true"
|
||||
export NZB_FOLDER_COUNT="50"
|
||||
|
||||
#How many nzbs to import per loop, if using NZB_THREADS=true the per folder
|
||||
export NZBCOUNT="50"
|
||||
export NZBCOUNT="5"
|
||||
|
||||
#Set, in seconds - how long the nzb-import should sleep between runs
|
||||
#below backfill
|
||||
export IMPORT_SLEEP="5"
|
||||
export IMPORT_SLEEP="0"
|
||||
|
||||
#Set the max amount of unprocessed releases and still allow nzb-import to run
|
||||
#set to 0 to disable
|
||||
|
||||
@@ -39,13 +39,32 @@ export ADMIN_PATH=$NEWZPATH"/www/admin"
|
||||
############################################################
|
||||
|
||||
#Post Processing Additional is the post processing that downloads rar files and attempts to get info for your site
|
||||
#you are able to set the number of process to be run from 1-32, remember that each process uses 1 of your nntp connections
|
||||
#so, if you have 20, and you set this to 32, you will have errors, lots of errors, nfo lookup uses 1 -3 connections
|
||||
#you are able to set the number of processes to be run from 1-32, remember that each process uses 1 of your nntp connections
|
||||
#so, if you have 20, and you set this to 32, you will have errors, lots of errors, nfo lookup uses 1-3 connections each
|
||||
#binaries and backfill threaded default up to 10 connections each and predb uses 1, so understand how many connections you are using when setting
|
||||
#trial and error for this, set to 1 will run > 0, set to 2 will run > 200, 3 will run > 300 and so on.
|
||||
#trial and error for this, set to 1 will run > 0, set to 2 will run > 200, 3 will run > 400 and so on.
|
||||
#At some point, increasing this begins to slow things down. It will need to be adjusted for your system
|
||||
#to get the desired performance, 0 will disable all post processing
|
||||
export POST_TO_RUN="0"
|
||||
#to get the desired performance, 0 will disable all post processing, but not category processing
|
||||
#the first window has up to 16 postprocess and can use primary or alternate NNTP provider
|
||||
export POST_TO_RUN_A="0"
|
||||
|
||||
#The second window also has 16 processes and can use promary or alternate NNTP provider
|
||||
export POST_TO_RUN_B="0"
|
||||
|
||||
#by modifying www/config.php like http://pastebin.com/VgH9DCZw, you can use 1 provider to run update_binaries
|
||||
#and backup and another provider to run post processing with. Or, 1 provider to run up to 16 postprocesses and another to run
|
||||
#up to 16 more postprocesses, or the same provider for everything
|
||||
#you can not switch providers without resetting all groups and truncating, I have included a script in scripts folders to reset and truncate
|
||||
#sudo scripts/reset_truncate.php
|
||||
#it is not necessary to run reset_truncate.php in order to second nntp provider for postprocessing only
|
||||
|
||||
#this one sets 1 provider for everything(false), or first provider for update_binaries and backfill and another for postprocessing(true)
|
||||
#this can not be changed after starting scripts
|
||||
export USE_TWO_NNTP="false"
|
||||
|
||||
#this allows you split the 32 postprocessing into 2 separate providers
|
||||
#this can not be changed after starting scripts
|
||||
export USE_TWO_PP="false"
|
||||
|
||||
############################################################
|
||||
|
||||
|
||||
@@ -24,17 +24,21 @@ source $DIR/../defaults.sh
|
||||
echo "Please edit this script, very carefully!"
|
||||
exit
|
||||
|
||||
export USER="username"
|
||||
export USER="your username"
|
||||
export PATH_RAMDISK="/var/ramdisk"
|
||||
export MYSQL_PATH="/var/lib/mysql/newznab"
|
||||
export SQL_BACKUP="/home/$USER/sql_backup"
|
||||
|
||||
#get userid for mysql
|
||||
USERID=`id -u mysql`
|
||||
GROUPID=`id -g mysql`
|
||||
|
||||
/etc/init.d/mysql stop
|
||||
|
||||
if ! grep -q '#RAMDISK' "/etc/fstab" ; then
|
||||
echo "" | sudo tee -a /etc/fstab
|
||||
echo "#RAMDISK" | sudo tee -a /etc/fstab
|
||||
echo "tmpfs $PATH_RAMDISK tmpfs user,nodev,nodiratime,nosuid,size=5G,mode=777 0 0" | sudo tee -a /etc/fstab
|
||||
echo "tmpfs $PATH_RAMDISK tmpfs rw,uid=$USERID,gid=$GROUPID,nodiratime,size=5G,nr_inodes=10k,mode=0700 0 0" | sudo tee -a /etc/fstab
|
||||
fi
|
||||
|
||||
mkdir -p $PATH_RAMDISK
|
||||
@@ -49,51 +53,50 @@ if [ ! -d "$SQL_BACKUP" ]; then
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -h "$MYSQL_PATH/parts.frm" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/parts.frm" ] && [ -f $MYSQL_PATH/parts.frm ]; then
|
||||
cp $MYSQL_PATH/parts.frm $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/parts.frm $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/parts.frm $MYSQL_PATH/
|
||||
fi
|
||||
if [ ! -h "$MYSQL_PATH/parts.MYD" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/parts.MYD" ] && [ -f $MYSQL_PATH/parts.MYD ]; then
|
||||
cp $MYSQL_PATH/parts.MYD $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/parts.MYD $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/parts.MYD $MYSQL_PATH/
|
||||
fi
|
||||
if [ ! -h "$MYSQL_PATH/parts.MYI" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/parts.MYI" ] && [ -f $MYSQL_PATH/parts.MYI ]; then
|
||||
cp $MYSQL_PATH/parts.MYI $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/parts.MYI $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/parts.MYI $MYSQL_PATH/
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -h "$MYSQL_PATH/partrepair.frm" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/partrepair.frm" ] && [ -f $MYSQL_PATH/partrepair.frm ]; then
|
||||
cp $MYSQL_PATH/partrepair.frm $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/partrepair.frm $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/partrepair.frm $MYSQL_PATH/
|
||||
fi
|
||||
if [ ! -h "$MYSQL_PATH/partrepair.MYD" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/partrepair.MYD" ] && [ -f $MYSQL_PATH/partrepair.MYD ]; then
|
||||
cp $MYSQL_PATH/partrepair.MYD $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/partrepair.MYD $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/partrepair.MYD $MYSQL_PATH/
|
||||
fi
|
||||
if [ ! -h "$MYSQL_PATH/partrepair.MYI" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/partrepair.MYI" ] && [ -f $MYSQL_PATH/partrepair.MYI ]; then
|
||||
cp $MYSQL_PATH/partrepair.MYI $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/partrepair.MYI $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/partrepair.MYI $MYSQL_PATH/
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -h "$MYSQL_PATH/binaries.frm" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/binaries.frm" ] && [ -f $MYSQL_PATH/binaries.frm ]; then
|
||||
cp $MYSQL_PATH/binaries.frm $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/binaries.frm $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/binaries.frm $MYSQL_PATH/
|
||||
fi
|
||||
if [ ! -h "$MYSQL_PATH/binaries.MYD" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/binaries.MYD" ] && [ -f $MYSQL_PATH/binaries.MYD ]; then
|
||||
cp $MYSQL_PATH/binaries.MYD $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/binaries.MYD $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/binaries.MYD $MYSQL_PATH/
|
||||
fi
|
||||
if [ ! -h "$MYSQL_PATH/binaries.MYI" ]; then
|
||||
if [ ! -h "$MYSQL_PATH/binaries.MYI" ] && [ -f $MYSQL_PATH/binaries.MYI ]; then
|
||||
cp $MYSQL_PATH/binaries.MYI $SQL_BACKUP/
|
||||
mv $MYSQL_PATH/binaries.MYI $PATH_RAMDISK/
|
||||
ln -s $PATH_RAMDISK/binaries.MYI $MYSQL_PATH/
|
||||
|
||||
@@ -30,43 +30,43 @@ export SQL_BACKUP="/home/$USER/sql_backup"
|
||||
|
||||
/etc/init.d/mysql stop
|
||||
|
||||
if [ -h "$MYSQL_PATH/parts.frm" ]; then
|
||||
if [ -h "$MYSQL_PATH/parts.frm" ] && [ -f $PATH_RAMDISK/parts.frm ]; then
|
||||
rm $MYSQL_PATH/parts.frm
|
||||
mv $PATH_RAMDISK/parts.frm $MYSQL_PATH/
|
||||
fi
|
||||
if [ -h "$MYSQL_PATH/parts.MYD" ]; then
|
||||
if [ -h "$MYSQL_PATH/parts.MYD" ] && [ -f $PATH_RAMDISK/parts.MYD ]; then
|
||||
rm $MYSQL_PATH/parts.MYD
|
||||
mv $PATH_RAMDISK/parts.MYD $MYSQL_PATH/
|
||||
fi
|
||||
if [ -h "$MYSQL_PATH/parts.MYI" ]; then
|
||||
if [ -h "$MYSQL_PATH/parts.MYI" ] && [ -f $PATH_RAMDISK/parts.MYI ]; then
|
||||
rm $MYSQL_PATH/parts.MYI
|
||||
mv $PATH_RAMDISK/parts.MYI $MYSQL_PATH/
|
||||
fi
|
||||
|
||||
|
||||
if [ -h "$MYSQL_PATH/partrepair.frm" ]; then
|
||||
if [ -h "$MYSQL_PATH/partrepair.frm" ] && [ -f $PATH_RAMDISK/partrepair.MYD ]; then
|
||||
rm $MYSQL_PATH/partrepair.frm
|
||||
mv $PATH_RAMDISK/partrepair.frm $MYSQL_PATH/
|
||||
fi
|
||||
if [ -h "$MYSQL_PATH/partrepair.MYD" ]; then
|
||||
if [ -h "$MYSQL_PATH/partrepair.MYD" ] && [ -f $PATH_RAMDISK/partrepair.MYD ]; then
|
||||
rm $MYSQL_PATH/partrepair.MYD
|
||||
mv $PATH_RAMDISK/partrepair.MYD $MYSQL_PATH/
|
||||
fi
|
||||
if [ -h "$MYSQL_PATH/partrepair.MYI" ]; then
|
||||
if [ -h "$MYSQL_PATH/partrepair.MYI" ] && [ -f $PATH_RAMDISK/partrepair.MYD ]; then
|
||||
rm $MYSQL_PATH/partrepair.MYI
|
||||
mv $PATH_RAMDISK/partrepair.MYI $MYSQL_PATH/
|
||||
fi
|
||||
|
||||
|
||||
if [ -h "$MYSQL_PATH/binaries.frm" ]; then
|
||||
if [ -h "$MYSQL_PATH/binaries.frm" ] && [ -f $PATH_RAMDISK/binaries.frm ]; then
|
||||
rm $MYSQL_PATH/binaries.frm
|
||||
mv $PATH_RAMDISK/binaries.frm $MYSQL_PATH/
|
||||
fi
|
||||
if [ -h "$MYSQL_PATH/binaries.MYD" ]; then
|
||||
if [ -h "$MYSQL_PATH/binaries.MYD" ] && [ -f $PATH_RAMDISK/binaries.MYD ]; then
|
||||
rm $MYSQL_PATH/binaries.MYD
|
||||
mv $PATH_RAMDISK/binaries.MYD $MYSQL_PATH/
|
||||
fi
|
||||
if [ -h "$MYSQL_PATH/binaries.MYI" ]; then
|
||||
if [ -h "$MYSQL_PATH/binaries.MYI" ] && [ -f $PATH_RAMDISK/binaries.MYI ]; then
|
||||
rm $MYSQL_PATH/binaries.MYI
|
||||
mv $PATH_RAMDISK/binaries.MYI $MYSQL_PATH/
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require(dirname(__FILE__)."/../bin/config.php");
|
||||
require_once(WWW_DIR."/lib/framework/db.php");
|
||||
|
||||
$db = new DB;
|
||||
|
||||
$rel = $db->query("update groups set backfill_target=0, first_record=0, first_record_postdate=null, last_record=0, last_record_postdate=null, last_updated=null");
|
||||
$rel = $db->query("truncate table parts");
|
||||
$rel = $db->query("truncate table partsrepair");
|
||||
$rel = $db->query("truncate table binaries;");
|
||||
|
||||
//get variables from config.sh and defaults.sh
|
||||
$path = dirname(__FILE__);
|
||||
$varnames = shell_exec("cat ".$path."/../config.sh | grep ^export | cut -d \= -f1 | awk '{print $2;}'");
|
||||
$varnames .= shell_exec("cat ".$path."/../defaults.sh | grep ^export | cut -d \= -f1 | awk '{print $2;}'");
|
||||
$vardata = shell_exec("cat ".$path."/../config.sh | grep ^export | cut -d \\\" -f2 | awk '{print $1;}'");
|
||||
$vardata .= shell_exec("cat ".$path."/../defaults.sh | grep ^export | cut -d \\\" -f2 | awk '{print $1;}'");
|
||||
$varnames = explode("\n", $varnames);
|
||||
$vardata = explode("\n", $vardata);
|
||||
$array = array_combine($varnames, $vardata);
|
||||
unset($array['']);
|
||||
|
||||
$TESTING="{$array['NEWZPATH']}{$array['TESTING_PATH']}";
|
||||
passthru("cd $TESTING && php spotnab.php -r");
|
||||
|
||||
?>
|
||||
@@ -129,22 +129,53 @@ else
|
||||
rm -f bin/lib/tvrage.php
|
||||
rm -f bin/processAdditional*
|
||||
rm -f bin/processAlternate*
|
||||
rm -f bin/lib/nntp2.php
|
||||
|
||||
#create postprocessing scripts
|
||||
for (( c=2; c<=32; c++ ))
|
||||
for (( c=2; c<=16; c++ ))
|
||||
do
|
||||
d=$((($c - 1) * 100))
|
||||
d=$((($c - 1) * 200))
|
||||
cp $NEWZPATH/www/lib/postprocess.php bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/PostProcess/PostProcess$c/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/echo \$iteration.*$/echo \$iteration --.\" \".\$rel['ID'].\" : \".\$rel['name'].\"\\\n\";/" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/processAdditional/processAdditional$c/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/\$tmpPath = \$this->site->tmpunrarpath;/\$tmpPath = \$this->site->tmpunrarpath; \\
|
||||
\$tmpPath .= '1\/tmp$c';/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/order by r.postdate desc limit %d.*\$/order by r.guid asc limit %d, %d \", (\$maxattemptstocheckpassworded + 1) * -1, $c * \$numtoProcess, \$numtoProcess));/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/PostPrc : Performing additional post processing.*\$/PostPrc : Performing additional post processing by guid on \".\$rescount.\" releases, starting at $d ...\";/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/order by r.postdate desc limit %d.*\$/order by r.guid asc limit %d, %d \", (\$maxattemptstocheckpassworded + 1) * -1, $c * 200, \$numtoProcess));/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/PostPrc : Performing additional post processing.*\$/PostPrc : Performing additional post processing by guid on \".\$rescount.\" releases, starting at $d ...\\n\";/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/\/\/echo \"PostPrc : Fetching/echo \"PostPrc : Fetching/g" bin/lib/postprocess$c.php
|
||||
if [[ $USE_TWO_NNTP == "true" ]] && [[ $USE_TWO_PP != "true" ]]; then
|
||||
$SED -i -e "s/require_once(WWW_DIR.\"\/lib\/nntp.php\");/require(dirname(__FILE__).\"\/nntp2.php\");/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/new Nntp;/new Nntp2;/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/doConnect/doConnect2/g" bin/lib/postprocess$c.php
|
||||
fi
|
||||
|
||||
cp bin/lib/additional bin/processAdditional$c.php
|
||||
$SED -i -e "s/1/$c/g" bin/processAdditional$c.php
|
||||
$SED -i -e "s/$numtoProcess = 100;/$numtoProcess = 20;/g" bin/lib/postprocess$c.php
|
||||
done
|
||||
|
||||
for (( c=17; c<=32; c++ ))
|
||||
do
|
||||
d=$((($c - 1) * 200))
|
||||
cp $NEWZPATH/www/lib/postprocess.php bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/PostProcess/PostProcess$c/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/echo \$iteration.*$/echo \$iteration --.\" \".\$rel['ID'].\" : \".\$rel['name'].\"\\\n\";/" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/processAdditional/processAdditional$c/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/\$tmpPath = \$this->site->tmpunrarpath;/\$tmpPath = \$this->site->tmpunrarpath; \\
|
||||
\$tmpPath .= '1\/tmp$c';/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/order by r.postdate desc limit %d.*\$/order by r.guid asc limit %d, %d \", (\$maxattemptstocheckpassworded + 1) * -1, ($c + 16) * 200, \$numtoProcess));/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/PostPrc : Performing additional post processing.*\$/PostPrc : Performing additional post processing by guid on \".\$rescount.\" releases, starting at $d ...\\n\";/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/\/\/echo \"PostPrc : Fetching/echo \"PostPrc : Fetching/g" bin/lib/postprocess$c.php
|
||||
if [[ $USE_TWO_NNTP == "true" ]] && [[ $USE_TWO_PP == "true" ]]; then
|
||||
$SED -i -e "s/require_once(WWW_DIR.\"\/lib\/nntp.php\");/require(dirname(__FILE__).\"\/nntp2.php\");/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/new Nntp;/new Nntp2;/g" bin/lib/postprocess$c.php
|
||||
$SED -i -e "s/doConnect/doConnect2/g" bin/lib/postprocess$c.php
|
||||
fi
|
||||
|
||||
cp bin/lib/additional bin/processAdditional$c.php
|
||||
$SED -i -e "s/1/$c/g" bin/processAdditional$c.php
|
||||
$SED -i -e "s/$numtoProcess = 100;/$numtoProcess = 20;/g" bin/lib/postprocess$c.php
|
||||
done
|
||||
|
||||
cp $NEWZPATH/www/lib/postprocess.php bin/lib/postprocess1.php
|
||||
@@ -157,7 +188,14 @@ else
|
||||
$SED -i -e "s/\$tmpPath = \$this->site->tmpunrarpath;/\$tmpPath = \$this->site->tmpunrarpath; \\
|
||||
\$tmpPath .= '1\/tmp1';/g" bin/lib/postprocess1.php
|
||||
$SED -i -e 's/order by r.postdate desc limit %d.*$/order by r.guid desc limit %d ", ($maxattemptstocheckpassworded + 1) * -1, $numtoProcess));/g' bin/lib/postprocess1.php
|
||||
$SED -i -e 's/PostPrc : Performing additional post processing.*$/PostPrc : Performing additional post processing by guid on ".$rescount." releases ...";/g' bin/lib/postprocess1.php
|
||||
$SED -i -e 's/PostPrc : Performing additional post processing.*$/PostPrc : Performing additional post processing by guid on ".$rescount." releases ...\\n";/g' bin/lib/postprocess1.php
|
||||
$SED -i -e "s/\/\/echo \"PostPrc : Fetching/echo \"PostPrc : Fetching/g" bin/lib/postprocess1.php
|
||||
$SED -i -e "s/$numtoProcess = 100;/$numtoProcess = 20;/g" bin/lib/postprocess1.php
|
||||
if [[ $USE_TWO_NNTP == "true" ]] && [[ $USE_TWO_PP != "true" ]]; then
|
||||
$SED -i -e "s/require_once(WWW_DIR.\"\/lib\/nntp.php\");/require(dirname(__FILE__).\"\/nntp2.php\");/g" bin/lib/postprocess1.php
|
||||
$SED -i -e "s/new Nntp;/new Nntp2;/g" bin/lib/postprocess1.php
|
||||
$SED -i -e "s/doConnect/doConnect2/g" bin/lib/postprocess1.php
|
||||
fi
|
||||
|
||||
|
||||
cp -f $NEWZPATH/www/lib/nfo.php bin/lib/nfo.php
|
||||
@@ -167,6 +205,17 @@ else
|
||||
cp -f $NEWZPATH/www/lib/music.php bin/lib/music1.php
|
||||
cp -f $NEWZPATH/www/lib/console.php bin/lib/console.php
|
||||
cp -f $NEWZPATH/www/lib/book.php bin/lib/book.php
|
||||
cp -f $NEWZPATH/www/lib/nntp.php bin/lib/nntp2.php
|
||||
|
||||
|
||||
$SED -i -e "s/function doConnect/function doConnect2/" bin/lib/nntp2.php
|
||||
$SED -i -e "s/NNTP_USERNAME/NNTP_USERNAME2/g" bin/lib/nntp2.php
|
||||
$SED -i -e "s/NNTP_PASSWORD/NNTP_PASSWORD2/g" bin/lib/nntp2.php
|
||||
$SED -i -e "s/NNTP_SERVER/NNTP_SERVER2/g" bin/lib/nntp2.php
|
||||
$SED -i -e "s/NNTP_PORT/NNTP_PORT2/g" bin/lib/nntp2.php
|
||||
$SED -i -e "s/NNTP_SSLENABLED/NNTP_SSLENABLED2/g" bin/lib/nntp2.php
|
||||
$SED -i -e "s/NNTPException/NNTPException2/g" bin/lib/nntp2.php
|
||||
$SED -i -e "s/class Nntp/class Nntp2/g" bin/lib/nntp2.php
|
||||
|
||||
$SED -i -e "s/500/250/" bin/lib/postprocess1.php
|
||||
$SED -i -e "s/500/250/" bin/lib/postprocess2.php
|
||||
|
||||
Reference in New Issue
Block a user