mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
added kevin123's update_parsing and binaryblacklist, changed optimize t wait for all process to finish before running, various other minor edits
This commit is contained in:
@@ -24,6 +24,12 @@
|
||||
mysql -u username -p newznab < scripts/tvrage-latest.sql
|
||||
```
|
||||
|
||||
* You can also import [kevin123's binaryblacklist](https://github.com/kevinlekiller/Newznab-Blacklist). This will overwrite all blacklists currently in you db.
|
||||
|
||||
```bash
|
||||
mysql -u username -p newznab < scripts/binaryblacklist.sql
|
||||
```
|
||||
|
||||
* Now, Clone my github. These scripts need to run from this location and this is where I was asked to put them. If you have decided to use an alternate location, you will need to edit the file bin/config.php to point to the file neqznab/www/config.php. If you do not, these scripts will not run.
|
||||
|
||||
```bash
|
||||
@@ -57,13 +63,13 @@
|
||||
cd ../ && ./start.sh
|
||||
```
|
||||
|
||||
* If you have grsec compiled into your kernel, you may need root privileges for nmon, bwm-ng and any other app that accesses the /proc folder.
|
||||
* If you have grsec compiled into your kernel, you may need root privileges for nmon, bwm-ng and any other app that accesses the /proc folder.
|
||||
|
||||
* Included in the scripts folder is revert.sh. This file will update your Newznab+ installation and overwrite the changes from these scripts.
|
||||
|
||||
* Almost any variable in defaults.sh can be changed, except the paths to the commands, and the changes will take effect on the next loop of the Monitor.
|
||||
|
||||
* 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 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 FreeBSD, you will need to add export TERM=xterm-256color to your .bashrc file to show 256 colors.
|
||||
|
||||
* If you are using the powerline status bar, you will most likely need a patched font. The Consolas ttf from [powerline-fonts](https://github.com/jonnyboy/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.
|
||||
|
||||
|
||||
+329
-183
@@ -2,7 +2,7 @@
|
||||
|
||||
require(dirname(__FILE__)."/config.php");
|
||||
require(WWW_DIR.'/lib/postprocess.php');
|
||||
$version="0.1r696";
|
||||
$version="0.1r698";
|
||||
|
||||
$db = new DB();
|
||||
|
||||
@@ -45,6 +45,7 @@ $_cj = dirname(__FILE__)."/../nnscripts";
|
||||
$NNPATH="{$array['NEWZPATH']}{$array['NEWZNAB_PATH']}";
|
||||
$TESTING="{$array['NEWZPATH']}{$array['TESTING_PATH']}";
|
||||
$killed="false";
|
||||
$old_session="{$array['TMUX_SESSION']}";
|
||||
|
||||
//build queries for shell
|
||||
$_backfill_increment = "UPDATE groups set backfill_target=backfill_target+1 where active=1 and backfill_target<{$array['MAXDAYS']};";
|
||||
@@ -284,13 +285,6 @@ while( $i > 0 )
|
||||
$ds3 = "stopped";
|
||||
$ds4 = "killed";
|
||||
|
||||
//kill panes if user changed to/from nzb import threaded
|
||||
if ( $_imports != $array['NZB_THREADS'] ) {
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'sleep 5' && $ds1 $panes0[4] $ds4");
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.1 'sleep 5' && $ds1 $panes0[1] $ds4");
|
||||
$_imports = $array['NZB_THREADS'];
|
||||
}
|
||||
|
||||
//get microtime to at start of queries
|
||||
$query_timer_start=microtime_float();
|
||||
|
||||
@@ -314,6 +308,16 @@ while( $i > 0 )
|
||||
$array = array_combine($varnames, $vardata);
|
||||
unset($array['']);
|
||||
|
||||
//rename the seesion
|
||||
if ( $old_session =! $array['TMUX_SESSION'] ) {
|
||||
shell_exec("$_tmux rename-session -t $old_session {$array['TMUX_SESSION']}");
|
||||
sleep(5);
|
||||
}
|
||||
$old_session="{$array['TMUX_SESSION']}";
|
||||
|
||||
//reset title
|
||||
printf("\033]0;{$array['TMUX_SESSION']}\007\003\n");
|
||||
|
||||
//get valuses from $posted_date
|
||||
$posted_date_result = @$db->query($posted_date);
|
||||
if ( $posted_date_result[0]['adddate'] ) { $firstdate = $posted_date_result[0]['adddate']; }
|
||||
@@ -450,6 +454,7 @@ while( $i > 0 )
|
||||
$panes2 = str_replace("\n", '', explode(" ", $panes_win_3));
|
||||
$panes3 = str_replace("\n", '', explode(" ", $panes_win_4));
|
||||
|
||||
//kill update_binaries.php backfill.php and import-nzb if timer exceeded
|
||||
$killit=explode(" ", relativeTime("$newestdate"));
|
||||
$killed="false";
|
||||
if ( $array['KILL_UPDATES'] != "0" ) {
|
||||
@@ -569,235 +574,331 @@ while( $i > 0 )
|
||||
$_tmux_test = $array['POWERLINE'];
|
||||
}
|
||||
|
||||
//check what is disabled and update panes window 3
|
||||
if ( $array['POST_TO_RUN'] == 0 ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.0 'echo \"\033[38;5;\"$color\"m\n$panes3[0] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.1 'echo \"\033[38;5;\"$color\"m\n$panes3[1] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.2 'echo \"\033[38;5;\"$color\"m\n$panes3[2] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.3 'echo \"\033[38;5;\"$color\"m\n$panes3[3] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.4 'echo \"\033[38;5;\"$color\"m\n$panes3[4] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.5 'echo \"\033[38;5;\"$color\"m\n$panes3[5] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.6 'echo \"\033[38;5;\"$color\"m\n$panes3[6] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.7 'echo \"\033[38;5;\"$color\"m\n$panes3[7] Disabled by POST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$forcekill="false";
|
||||
$ok_to_run="false";
|
||||
if (( $array['OPTIMIZE_KILL'] == "true" ) && ( $array['OPTIMIZE'] == "true" )) {
|
||||
$forcekill="true";
|
||||
}
|
||||
|
||||
//kills postprocessing in window 2
|
||||
$post = $array['POST_TO_RUN'];
|
||||
for ($g=$post; $g<=31; $g++)
|
||||
{
|
||||
$h=$g+1;
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:2.$g 'echo \"\033[38;5;\"$color\"m\n$panes2[$g]\nDisabled by \nPOST_TO_RUN\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run update_predb.php in 1.0 ever 15 minutes
|
||||
if (( TIME() - $time2 ) >= $array['PREDB_TIMER'] ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.0 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[0] $ds2 && cd $NNPATH && $_php update_predb.php true 2>&1 | tee -a $path/../logs/$panes1[0]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[0] $ds3' 2>&1 1> /dev/null");
|
||||
$time2 = TIME();
|
||||
} else {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['PREDB_TIMER'] + $time2 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.0 'echo \"\033[38;5;\"$color\"m\n$panes1[0] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run $_php update_parsing.php in 1.1 every 1 hour
|
||||
if (((( TIME() - $time3 ) >= $array['PARSING_TIMER'] ) || ( $i == 1 )) && ($array['PARSING'] == "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[1] $ds2 && cd $TESTING && $_php update_parsing.php 2>&1 | tee -a $path/../logs/$panes1[1]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[1] $ds3' 2>&1 1> /dev/null");
|
||||
$time3 = TIME();
|
||||
} elseif ( $array['PARSING'] != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\n$panes1[1] Disabled by PARSING\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['PARSING_TIMER'] + $time3 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\n$panes1[1] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run $_php removespecial.php and $_php update_cleanup.php in 1.2 ever 1 hour
|
||||
if ((( TIME() - $time7 ) >= $array['CLEANUP_TIMER'] ) && ($array['CLEANUP'] == "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[2] $ds2 && cd $TESTING && $_php removespecial.php 2>&1 | tee -a $path/../logs/$panes1[2]-$getdate.log && $_php update_cleanup.php 2>&1 | tee -a $path/../logs/$panes1[2]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[2] $ds3' 2>&1 1> /dev/null");
|
||||
$time7 = TIME();
|
||||
} elseif ( $array['CLEANUP'] != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\n$panes1[2] Disabled by CLEANUP\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['CLEANUP_TIMER'] + $time7 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\n$panes1[2] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run update_tvschedule.php and $_php update_theaters.php in 1.3 every 12 hours and first loop
|
||||
if ((( TIME() - $time4 ) >= $array['TVRAGE_TIMER']) || ( $i == 1 )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.3 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[3] $ds2 && cd $NNPATH && $_php update_tvschedule.php 2>&1 | tee -a $path/../logs/$panes1[3]-$getdate.log && $_php update_theaters.php 2>&1 | tee -a $path/../logs/$panes1[3]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[3] $ds3' 2>&1 1> /dev/null");
|
||||
$time4 = TIME();
|
||||
} else {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['TVRAGE_TIMER'] + $time4 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.3 'echo \"\033[38;5;\"$color\"m\n$panes1[3] and update_theaters will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
//kill all panes to run optimize if OPTIMIZE_KILL is true
|
||||
if ((( TIME() - $time6 >= $array['MYISAM_LARGE'] ) || ( TIME() - $time8 >= $array['INNODB_LARGE'] ) || ( TIME() - $time5 >= $array['INNODB_SMALL'] ) || ( TIME() - $time11 >= $array['MYISAM_SMALL'] )) && ( $forcekill == "false")) {
|
||||
$dead1 = str_replace( " ", '', `tmux list-panes -t {$array['TMUX_SESSION']}:0 | grep dead | wc -l` );
|
||||
$dead2 = str_replace( " ", '', `tmux list-panes -t {$array['TMUX_SESSION']}:1 | grep dead | wc -l` );
|
||||
$dead3 = str_replace( " ", '', `tmux list-panes -t {$array['TMUX_SESSION']}:2 | grep dead | wc -l` );
|
||||
$dead4 = str_replace( " ", '', `tmux list-panes -t {$array['TMUX_SESSION']}:3 | grep dead | wc -l` );
|
||||
if (( $dead1 == 5 ) && ( $dead2 == 8 ) && ( $dead3 == 32 ) && ( $dead4 == 8 )) {
|
||||
$ok_to_run="true";
|
||||
} else {
|
||||
$ok_to_run="false";
|
||||
}
|
||||
} elseif ((( TIME() - $time6 >= $array['MYISAM_LARGE'] ) || ( TIME() - $time8 >= $array['INNODB_LARGE'] ) || ( TIME() - $time5 >= $array['INNODB_SMALL'] ) || ( TIME() - $time11 >= $array['MYISAM_SMALL'] )) && ( $forcekill == "true")) {
|
||||
for ($g=1; $g<=5; $g++)
|
||||
{
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.$g 'echo \"\033[38;5;\"$color\"m\n$panes0[$g]\nKilled in prep for \nOptimization\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
for ($g=0; $g<=7; $g++)
|
||||
{
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:1.$g 'echo \"\033[38;5;\"$color\"m\n$panes1[$g]\nKilled in prep for \nOptimization\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:3.$g 'echo \"\033[38;5;\"$color\"m\n$panes3[$g]\nKilled in prep for \nOptimization\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
for ($g=0; $g<=32; $g++)
|
||||
{
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.$g 'echo \"\033[38;5;\"$color\"m\n$panes0[$g]\nKilled in prep for \nOptimization\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
sleep(10);
|
||||
$ok_to_run="true";
|
||||
}
|
||||
|
||||
//run optimize in pane 1.4
|
||||
if (( TIME() - $time6 >= $array['MYISAM_LARGE'] ) && ( $array['OPTIMIZE'] == "true" )) {
|
||||
if (( TIME() - $time6 >= $array['MYISAM_LARGE'] ) && ( $array['OPTIMIZE'] == "true" ) && ( $ok_to_run == "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\" && $ds1 MYISAM_LARGE $ds2 && cd $_bin && $_php optimize_myisam.php true 2>&1 | tee -a $path/../logs/$panes1[4]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 MYISAM_LARGE $ds3' 2>&1 1> /dev/null");
|
||||
$time6 = TIME();
|
||||
} elseif (( TIME() - $time8 >= $array['INNODB_LARGE'] ) && ($array['INNODB'] == "true") && ( $array['OPTIMIZE'] == "true" )) {
|
||||
} elseif (( TIME() - $time8 >= $array['INNODB_LARGE'] ) && ($array['INNODB'] == "true") && ( $array['OPTIMIZE'] == "true" ) && ( $ok_to_run == "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\" && $ds1 INNODB_LARGE $ds2 && cd $_bin && $_php optimize_myisam.php true 2>&1 | tee -a $path/../logs/$panes1[4]-$getdate.log && $_php optimize_innodb.php true 2>&1 | tee -a $path/../logs/$panes1[4]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 INNODB_LARGE $ds3' 2>&1 1> /dev/null");
|
||||
$time8 = TIME();
|
||||
} elseif (( TIME() - $time5 >= $array['INNODB_SMALL'] ) && ( $array['INNODB']== "true" ) && ( $array['OPTIMIZE'] == "true" )) {
|
||||
} elseif (( TIME() - $time5 >= $array['INNODB_SMALL'] ) && ( $array['INNODB']== "true" ) && ( $array['OPTIMIZE'] == "true" ) && ( $ok_to_run == "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\" && $ds1 INNODB_SMALL $ds2 && cd $_bin && $_php optimize_innodb.php 2>&1 | tee -a $path/../logs/$panes1[4]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 INNODB_SMALL $ds3' 2>&1 1> /dev/null");
|
||||
$time5 = TIME();
|
||||
} elseif (( TIME() - $time11 >= $array['MYISAM_SMALL'] ) && ( $array['OPTIMIZE'] == "true" )) {
|
||||
} elseif (( TIME() - $time11 >= $array['MYISAM_SMALL'] ) && ( $array['OPTIMIZE'] == "true" ) && ( $ok_to_run == "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\" && $ds1 MYISAM_SMALL $ds2 && cd $_bin && $_php optimize_myisam.php 2>&1 | tee -a $path/../logs/$panes1[4]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 MYISAM_SMALL $ds3' 2>&1 1> /dev/null");
|
||||
$time11 = TIME();
|
||||
} elseif ( $array['OPTIMIZE'] != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\nOptimize Disabled by OPTIMIZE\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\nOptimize Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
$color = get_color();
|
||||
$run_time1 = relativeTime( $array['MYISAM_LARGE'] + $time6 );
|
||||
$run_time2 = relativeTime( $array['INNODB_LARGE'] + $time8 );
|
||||
$run_time3 = relativeTime( $array['INNODB_SMALL'] + $time5 );
|
||||
$run_time4 = relativeTime( $array['MYISAM_SMALL'] + $time11 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\nMYISAM_LARGE will run in $run_time1 \nINNODB_LARGE will run in $run_time2 \nINNODB_SMALL will run in $run_time3 \nMYISAM_SMALL will run in $run_time4\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.4 'echo \"\033[38;5;\"$color\"m\nMYISAM_LARGE will run in T[$run_time]1 \nINNODB_LARGE will run in T[$run_time]2\nINNODB_SMALL will run in T[$run_time]3 \nMYISAM_SMALL will run in T[$run_time]4\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
if (( shell_exec("$_tmux list-panes -t {$array['TMUX_SESSION']}:1 | grep 4: | grep dead")) && ( $array['OPTIMIZE'] == "true" )) {
|
||||
$optimize_safe_to_run="true";
|
||||
} else {
|
||||
$optimize_safe_to_run="false";
|
||||
}
|
||||
|
||||
//run update_predb.php in 1.0 ever 15 minutes and on first loop
|
||||
if (((( TIME() - $time2 ) >= $array['PREDB_TIMER'] ) || ( $i == 1 )) && ( $array['PREDB'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.0 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[0] $ds2 && cd $NNPATH && $_php update_predb.php true 2>&1 | tee -a $path/../logs/$panes1[0]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[0] $ds3' 2>&1 1> /dev/null");
|
||||
$time2 = TIME();
|
||||
} elseif (( $array['PREDB'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['PREDB_TIMER'] + $time2 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.0 'echo \"\033[38;5;\"$color\"m\n$panes1[0] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['PREDB'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.0 'echo \"\033[38;5;\"$color\"m\n$panes1[0] Disabled by PREDB\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.0 'echo \"\033[38;5;\"$color\"m\n$panes1[0] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
|
||||
//run $_php update_parsing.php in 1.1 every 1 hour and on first loop
|
||||
if (((( TIME() - $time3 ) >= $array['PARSING_TIMER'] ) || ( $i == 1 )) && ($array['PARSING_MOD'] != "true" )&& ($array['PARSING'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[1] $ds2 && cd $TESTING && $_php update_parsing.php 2>&1 | tee -a $path/../logs/$panes1[1]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[1] $ds3' 2>&1 1> /dev/null");
|
||||
$time3 = TIME();
|
||||
} elseif (((( TIME() - $time3 ) >= $array['PARSING_TIMER'] ) || ( $i == 1 )) && ($array['PARSING_MOD'] == "true" )&& ($array['PARSING'] == "true" ) && ( $optimize_safe_$
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[1] $ds2 && cd $_bin && $_php update_parsing.php $
|
||||
$time3 = TIME();
|
||||
} elseif (( $array['PARSING'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\n$panes1[1] Disabled by PARSING\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['PARSING_TIMER'] + $time3 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\n$panes1[1] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.1 'echo \"\033[38;5;\"$color\"m\n$panes1[1] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run $_php removespecial.php and $_php update_cleanup.php in 1.2 ever 1 hour
|
||||
if ((( TIME() - $time7 ) >= $array['CLEANUP_TIMER'] ) && ($array['CLEANUP'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[2] $ds2 && cd $TESTING && $_php removespecial.php 2>&1 | tee -a $path/../logs/$panes1[2]-$getdate.log && $_php update_cleanup.php 2>&1 | tee -a $path/../logs/$panes1[2]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[2] $ds3' 2>&1 1> /dev/null");
|
||||
$time7 = TIME();
|
||||
} elseif (( $array['CLEANUP'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\n$panes1[2] Disabled by CLEANUP\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['CLEANUP_TIMER'] + $time7 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\n$panes1[2] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.2 'echo \"\033[38;5;\"$color\"m\n$panes1[2] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run update_tvschedule.php and $_php update_theaters.php in 1.3 every 12 hours and first loop
|
||||
if (((( TIME() - $time4 ) >= $array['TVRAGE_TIMER']) || ( $i == 1 )) && ( $array['TV_SCHEDULE'] == "true") && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.3 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[3] $ds2 && cd $NNPATH && $_php update_tvschedule.php 2>&1 | tee -a $path/../logs/$panes1[3]-$getdate.log && $_php update_theaters.php 2>&1 | tee -a $path/../logs/$panes1[3]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[3] $ds3' 2>&1 1> /dev/null");
|
||||
$time4 = TIME();
|
||||
} elseif (( $array['TV_SCHEDULE'] == "true") && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['TVRAGE_TIMER'] + $time4 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.3 'echo \"\033[38;5;\"$color\"m\n$panes1[3] and update_theaters will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['TV_SCHEDULE'] != "true") && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.3 'echo \"\033[38;5;\"$color\"m\n$panes1[3] Disabled by TV_SCHEDULE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.3 'echo \"\033[38;5;\"$color\"m\n$panes1[3] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run sphinx in pane 1.5
|
||||
if (( TIME() - $time9 >= $array['SPHINX_TIMER'] ) && ( $array['SPHINX'] == "true")) {
|
||||
if (( TIME() - $time9 >= $array['SPHINX_TIMER'] ) && ( $array['SPHINX'] == "true") && ( $optimize_safe_to_run != "true" )) {
|
||||
$color=get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.5 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[5] $ds2 && cd $_bin && $_php sphinx.php 2>&1 | tee -a $path/../logs/$panes1[5]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes1[5] $ds3' 2>&1 1> /dev/null");
|
||||
$time9 = TIME();
|
||||
} elseif ( $array['SPHINX'] != "true" ) {
|
||||
} elseif (( $array['SPHINX'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.5 'echo \"\033[38;5;\"$color\"m\n$panes1[5] Disabled by SPHINX\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.5 'echo \"\033[38;5;\"$color\"m\n$panes1[5] Disabled by SPHINX\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['SPHINX_TIMER'] + $time9 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.5 'echo \"\033[38;5;\"$color\"m\n$panes1[5] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.5 'echo \"\033[38;5;\"$color\"m\n$panes1[5] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.5 'echo \"\033[38;5;\"$color\"m\n$panes1[5] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run delete parts in pane 1.6
|
||||
if ((( TIME() - $time16 ) >= $array['DELETE_TIMER'] ) && ( $array['DELETE_PARTS'] == "true" )) {
|
||||
if ((( TIME() - $time16 ) >= $array['DELETE_TIMER'] ) && ( $array['DELETE_PARTS'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.6 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[6] $ds2 && cd $_cj && $_php remove_parts_without_releases.php 2>&1 | tee -a $path/../logs/$panes1[6]-$getdate.log && $ds1 $panes1[6] $ds3' 2>&1 1> /dev/null");
|
||||
$time16 = TIME();
|
||||
} elseif ( $array['DELETE_PARTS'] != "true" ) {
|
||||
} elseif (( $array['DELETE_PARTS'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.6 'echo \"\033[38;5;\"$color\"m\n$panes1[6] Disabled by DELETE_PARTS\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.6 'echo \"\033[38;5;\"$color\"m\n$panes1[6] Disabled by DELETE_PARTS\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['DELETE_TIMER'] + $time16 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.6 'echo \"\033[38;5;\"$color\"m\n$panes1[6] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.6 'echo \"\033[38;5;\"$color\"m\n$panes1[6] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.6 'echo \"\033[38;5;\"$color\"m\n$panes1[6] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//run update_missing_movie_info parts in pane 1.7
|
||||
if (((( TIME() - $time17 ) >= $array['MOVIE_TIMER'] ) || ( $i == 1 )) && ( $array['FETCH_MOVIE'] == "true" )) {
|
||||
if (((( TIME() - $time17 ) >= $array['MOVIE_TIMER'] ) || ( $i == 1 )) && ( $array['FETCH_MOVIE'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.7 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes1[7] $ds2 && cd $_cj && $_php update_missing_movie_info.php 2>&1 | tee -a $path/../logs/$panes1[7]-$getdate.log && $ds1 $panes1[7] $ds3' 2>&1 1> /dev/null");
|
||||
$time17 = TIME();
|
||||
} elseif ( $array['FETCH_MOVIE'] != "true" ) {
|
||||
} elseif (( $array['FETCH_MOVIE'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.7 'echo \"\033[38;5;\"$color\"m\n$panes1[7] Disabled by FETCH_MOVIE\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.7 'echo \"\033[38;5;\"$color\"m\n$panes1[7] Disabled by FETCH_MOVIE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['MOVIE_TIMER'] + $time17 );
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.7 'echo \"\033[38;5;\"$color\"m\n$panes1[7] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.7 'echo \"\033[38;5;\"$color\"m\n$panes1[7] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:1.7 'echo \"\033[38;5;\"$color\"m\n$panes1[7] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs postprocess_nfo.php in pane 3.0 once if needed then exits
|
||||
if (( $nfo_remaining_now > 0 ) && ( $array['POST_TO_RUN'] != 0 )) {
|
||||
if (( $nfo_remaining_now > 0 ) && ( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.0 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[0] $ds2 && cd $_bin && $_php postprocess_nfo.php 2>&1 | tee -a $path/../logs/$panes3[0]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[0] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.0 'echo \"\033[38;5;\"$color\"m\n$panes3[0] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.0 'echo \"\033[38;5;\"$color\"m\n$panes3[0] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.0 'echo \"\033[38;5;\"$color\"m\n$panes3[0] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.0 'echo \"\033[38;5;\"$color\"m\n$panes3[0] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processGames.php in pane y3.1 once if needed then exits
|
||||
if (( $console_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 )) {
|
||||
if (( $console_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.1 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[1] $ds2 && cd $_bin && $_php processGames.php 2>&1 | tee -a $path/../logs/$panes3[1]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[1] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.1 'echo \"\033[38;5;\"$color\"m\n$panes3[1] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.1 'echo \"\033[38;5;\"$color\"m\n$panes3[1] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.1 'echo \"\033[38;5;\"$color\"m\n$panes3[1] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.1 'echo \"\033[38;5;\"$color\"m\n$panes3[1] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processMovies.php in pane 3.2 once if needed then exits
|
||||
if (( $movie_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 )) {
|
||||
if (( $movie_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.2 'echo \"\033[38;5;\"$color\"\" && $ds1 $panes3[2] $ds2 && cd $_bin && $_php processMovies.php 2>&1 | tee -a $path/../logs/$panes3[2]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[2] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.2 'echo \"\033[38;5;\"$color\"m\n$panes3[2] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.2 'echo \"\033[38;5;\"$color\"m\n$panes3[2] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.2 'echo \"\033[38;5;\"$color\"m\n$panes3[2] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.2 'echo \"\033[38;5;\"$color\"m\n$panes3[2] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processMusic.php in pane 3.3 once if needed then exits
|
||||
if (( $music_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 )) {
|
||||
if (( $music_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.3 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[3] $ds2 && cd $_bin && $_php processMusic.php 2>&1 | tee -a $path/../logs/$panes3[3]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[3] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.3 'echo \"\033[38;5;\"$color\"m\n$panes3[3] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.3 'echo \"\033[38;5;\"$color\"m\n$panes3[3] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.3 'echo \"\033[38;5;\"$color\"m\n$panes3[3] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.3 'echo \"\033[38;5;\"$color\"m\n$panes3[3] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processTv.php in pane 3.4 once if needed then exits
|
||||
if (( $tvrage_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 )) {
|
||||
if (( $tvrage_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.4 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[4] $ds2 && cd $_bin && $_php processTv.php 2>&1 | tee -a $path/../logs/$panes3[4]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[4] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.4 'echo \"\033[38;5;\"$color\"m\n$panes3[4] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.4 'echo \"\033[38;5;\"$color\"m\n$panes3[4] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.4 'echo \"\033[38;5;\"$color\"m\n$panes3[4] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.4 'echo \"\033[38;5;\"$color\"m\n$panes3[4] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processBooks.php in pane 3.5 once if needed then exits
|
||||
if (( $book_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 )) {
|
||||
if (( $book_releases_proc > 0 ) && ( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.5 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[5] $ds2 && cd $_bin && $_php processBooks.php 2>&1 | tee -a $path/../logs/$panes3[5]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[5] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.5 'echo \"\033[38;5;\"$color\"m\n$panes3[5] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.5 'echo \"\033[38;5;\"$color\"m\n$panes3[5] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.5 'echo \"\033[38;5;\"$color\"m\n$panes3[5] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.5 'echo \"\033[38;5;\"$color\"m\n$panes3[5] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processOthers.php in pane 3.6 once if needed then exits
|
||||
if ( $array['POST_TO_RUN'] != 0 ) {
|
||||
if (( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.6 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[6] $ds2 && cd $_bin && $_php processOthers.php 2>&1 | tee -a $path/../logs/$panes3[6]-$getdate.log && echo \" \033[1;0;33m\" && $ds1 $panes3[6] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.6 'echo \"\033[38;5;\"$color\"m\n$panes3[6] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.6 'echo \"\033[38;5;\"$color\"m\n$panes3[6] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.6 'echo \"\033[38;5;\"$color\"m\n$panes3[6] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.6 'echo \"\033[38;5;\"$color\"m\n$panes3[6] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs processUnwanted.php in pane 3.7 in continuous loop, will restart if exits
|
||||
if ( $array['POST_TO_RUN'] != 0 ) {
|
||||
if (( $array['POST_TO_RUN'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.7 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes3[7] $ds2 && cd $_bin && $_php processUnwanted.php 2>&1 | tee -a $path/../logs/$panes3[7]-$getdate.log && echo \" \033[1;0;33;33m\" && $ds1 $panes3[7] $ds3' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['POST_TO_RUN'] == 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.7 'echo \"\033[38;5;\"$color\"m\n$panes3[7] Has no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.7 'echo \"\033[38;5;\"$color\"m\n$panes3[7] Disabled by POST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run != "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.7 'echo \"\033[38;5;\"$color\"m\n$panes3[7] Has no work to process \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:3.7 'echo \"\033[38;5;\"$color\"m\n$panes3[7] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//set command for running update_binaries
|
||||
if ( $array['BINARIES_THREADS'] == "true" ) {
|
||||
if (( $array['BINARIES_THREADS'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$_update_cmd = "cd $_bin && $_php update_binaries_threaded.php 2>&1 | tee -a $path/../logs/$panes0[2]-$getdate.log";
|
||||
} else {
|
||||
$_update_cmd = "cd $NNPATH && $_php update_binaries.php 2>&1 | tee -a $path/../logs/$panes0[2]-$getdate.log";
|
||||
}
|
||||
|
||||
//set command for running backfill
|
||||
if ( $array['KEVIN_SAFER'] == "true" ) {
|
||||
if (( $array['KEVIN_SAFER'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$_backfill_cmd = "cd $_bin && $_php safer_backfill_parts.php 2>&1 | tee -a $path/../logs/$panes0[3]-$getdate.log";
|
||||
} elseif ( $array['BACKFILL_THREADS'] == "true" ) {
|
||||
$_backfill_cmd = "cd $_bin && $_php backfill_threaded.php 2>&1 | tee -a $path/../logs/$panes0[3]-$getdate.log && $mysql_command_1 2>&1 | tee -a $path/../logs/$panes0[3]-$getdate.log";
|
||||
@@ -806,7 +907,7 @@ while( $i > 0 )
|
||||
}
|
||||
|
||||
//set command for nzb-import
|
||||
if ( $array['NZB_THREADS'] == "true" ) {
|
||||
if (( $array['NZB_THREADS'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$nzb_cmd = "$_php nzb-import-sub.php \"{$array['NZBS']}\"";
|
||||
} else {
|
||||
$nzb_cmd = "$_php nzb-import.php \"{$array['NZBS']}\" \"{$array['IMPORT_TRUE']}\"";
|
||||
@@ -815,145 +916,180 @@ while( $i > 0 )
|
||||
//check if sequential is set
|
||||
if ( $array['SEQUENTIAL'] != "true" ) {
|
||||
//runs update_binaries in 0.2 once if needed and exits
|
||||
if (( $killed != "true" ) && ( $array['BINARIES'] == "true" ) && (( $total_work_used < $array['BINARIES_MAX_RELEASES'] ) || ( $array['BINARIES_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BINARIES_MAX_ROWS'] ) || ( $array['BINARIES_MAX_ROWS'] == 0 ))) {
|
||||
if (( $killed != "true" ) && ( $array['BINARIES'] == "true" ) && (( $total_work_used < $array['BINARIES_MAX_RELEASES'] ) || ( $array['BINARIES_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BINARIES_MAX_ROWS'] ) || ( $array['BINARIES_MAX_ROWS'] == 0 )) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[2] $ds2 && $_update_cmd 2>&1 | tee -a $path/../logs/$panes0[2]-$getdate.log && echo \" \033[1;0;33m\" && echo \"$_sleep_string {$array['BINARIES_SLEEP']} seconds...\" && sleep {$array['BINARIES_SLEEP']} && $ds1 $panes0[2] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif (( $parts_rows_unformated > $array['BINARIES_MAX_ROWS'] ) && ( $array['BINARIES'] == "true" ) && ( $array['BINARIES_MAX_ROWS'] != 0 )) {
|
||||
} elseif (( $parts_rows_unformated > $array['BINARIES_MAX_ROWS'] ) && ( $array['BINARIES'] == "true" ) && ( $array['BINARIES_MAX_ROWS'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\nBINARIES_MAX_ROWS exceeded\" && $ds1 $panes0[2] $ds4'");
|
||||
} elseif (( $total_work_used > $array['BINARIES_MAX_RELEASES'] ) && ( $array['BINARIES'] == "true" ) && ( $array['BINARIES_MAX_RELEASES'] != 0 )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\nBINARIES_MAX_ROWS exceeded\" && $ds1 $panes0[2] $ds4'");
|
||||
} elseif (( $total_work_used > $array['BINARIES_MAX_RELEASES'] ) && ( $array['BINARIES'] == "true" ) && ( $array['BINARIES_MAX_RELEASES'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\nBINARIES_MAX_RELEASES exceeded\" && $ds1 $panes0[2] $ds4'");
|
||||
} elseif ( $array['BINARIES'] != "true" ) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\nBINARIES_MAX_RELEASES exceeded\" && $ds1 $panes0[2] $ds4'");
|
||||
} elseif (( $array['BINARIES'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] Disabled by BINARIES\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] Disabled by BINARIES\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs backfill in 0.3 once if needed and exits
|
||||
if (( $killed != "true" ) && ( $array['BACKFILL'] == "true" ) && (( $total_work_used < $array['BACKFILL_MAX_RELEASES'] ) || ( $array['BACKFILL_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BACKFILL_MAX_ROWS'] ) || ( $array['BACKFILL_MAX_ROWS'] == 0 ))) {
|
||||
if (( $killed != "true" ) && ( $array['BACKFILL'] == "true" ) && (( $total_work_used < $array['BACKFILL_MAX_RELEASES'] ) || ( $array['BACKFILL_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BACKFILL_MAX_ROWS'] ) || ( $array['BACKFILL_MAX_ROWS'] == 0 )) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[3] $ds2 && $_backfill_cmd 2>&1 | tee -a $path/../logs/$panes0[3]-$getdate.log && echo \" \033[1;0;33m\" && echo \"$_sleep_string {$array['BACKFILL_SLEEP']} seconds...\" && sleep {$array['BACKFILL_SLEEP']} && $ds1 $panes0[3] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif (( $parts_rows_unformated > $array['BACKFILL_MAX_ROWS'] ) && ( $array['BACKFILL'] == "true" ) && ( $array['BACKFILL_MAX_ROWS'] != 0 )) {
|
||||
} elseif (( $parts_rows_unformated > $array['BACKFILL_MAX_ROWS'] ) && ( $array['BACKFILL'] == "true" ) && ( $array['BACKFILL_MAX_ROWS'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\nBACKFILL_MAX_ROWS exceeded\" && $ds1 $panes0[3] $ds4'");
|
||||
} elseif (( $total_work_used > $array['BACKFILL_MAX_RELEASES'] ) && ( $array['BACKFILL'] == "true" ) && ( $array['BACKFILL_MAX_RELEASES'] != 0 )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\nBACKFILL_MAX_ROWS exceeded\" && $ds1 $panes0[3] $ds4'");
|
||||
} elseif (( $total_work_used > $array['BACKFILL_MAX_RELEASES'] ) && ( $array['BACKFILL'] == "true" ) && ( $array['BACKFILL_MAX_RELEASES'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\nBACKFILL_MAX_RELEASES exceeded\" && $ds1 $panes0[3] $ds4'");
|
||||
} elseif ( $array['BACKFILL'] != "true" ) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\nBACKFILL_MAX_RELEASES exceeded\" && $ds1 $panes0[3] $ds4'");
|
||||
} elseif (( $array['BACKFILL'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] Disabled by BACKFILL\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] Disabled by BACKFILL\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
//run update_binaries and backfill using seq in pane 0.2
|
||||
$dead = `$_tmux list-panes -t {$array['TMUX_SESSION']}:0 | grep 2: | grep dead`;
|
||||
if (( $killed != "true" ) && ( $array['SEQUENTIAL'] == "true" ) && ( strlen( $dead ) > "4" )) {
|
||||
if ((( $i == 1 ) || ( TIME() - $time13 >= $array['BINARIES_SEQ_TIMER'] )) && ( $array['BINARIES'] == "true" ) && (( $total_work_used < $array['BINARIES_MAX_RELEASES'] ) || ( $array['BINARIES_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BINARIES_MAX_ROWS'] ) || ( $array['BINARIES_MAX_ROWS'] == 0 ))) {
|
||||
if ((( $i == 1 ) || ( TIME() - $time13 >= $array['BINARIES_SEQ_TIMER'] )) && ( $array['BINARIES'] == "true" ) && (( $total_work_used < $array['BINARIES_MAX_RELEASES'] ) || ( $array['BINARIES_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BINARIES_MAX_ROWS'] ) || ( $array['BINARIES_MAX_ROWS'] == 0 )) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[2] $ds2 && $_update_cmd && echo \" \033[1;0;33m\" && $ds1 $panes0[2] $ds3' 2>&1 1> /dev/null");
|
||||
$time13 = TIME();
|
||||
} elseif (( TIME() - $time14 >= $array['BACKFILL_SEQ_TIMER'] ) && ( $array['BACKFILL'] == "true" ) && (( $total_work_used < $array['BACKFILL_MAX_RELEASES'] ) || ( $array['BACKFILL_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BACKFILL_MAX_ROWS'] ) || ( $array['BACKFILL_MAX_ROWS'] == 0 ))) {
|
||||
} elseif (( TIME() - $time14 >= $array['BACKFILL_SEQ_TIMER'] ) && ( $array['BACKFILL'] == "true" ) && (( $total_work_used < $array['BACKFILL_MAX_RELEASES'] ) || ( $array['BACKFILL_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['BACKFILL_MAX_ROWS'] ) || ( $array['BACKFILL_MAX_ROWS'] == 0 )) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[3] $ds2 && $_backfill_cmd && echo \" \033[1;0;33m\" && $ds1 $panes0[3] $ds3' 2>&1 1> /dev/null");
|
||||
$time14 = TIME();
|
||||
} elseif (( $array['BINARIES'] != "true" ) && ( $array['BACKFILL'] != "true" )) {
|
||||
} elseif (( $array['BINARIES'] != "true" ) && ( $array['BACKFILL'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] and $panes0[3] Disabled by BINARIES and BACKFILL\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BACKFILL'] == "true" ) && ( $array['BINARIES'] == "true" )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] and $panes0[3] Disabled by BINARIES and BACKFILL\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BACKFILL'] == "true" ) && ( $array['BINARIES'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
$run_time1 = relativeTime( $array['BACKFILL_SEQ_TIMER'] + $time14 );
|
||||
$run_time2 = relativeTime( $array['BINARIES_SEQ_TIMER'] + $time13 );
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in $run_time2 \n$panes0[3] will run in $run_time1 \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $array['BACKFILL'] == "true" ) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in T[$run_time2]\n$panes0[3] will run in T[$run_time]1 \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BACKFILL'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['BACKFILL_SEQ_TIMER'] + $time14 );
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[3] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $array['BINARIES'] == "true" ) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[3] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BINARIES'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
$run_time = relativeTime( $array['BINARIES_SEQ_TIMER'] + $time13 );
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in $run_time\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
//display runtime information for seq in pane 0.3
|
||||
//notify pane 0.3 of the status of pane 0.2
|
||||
if ( $array['SEQUENTIAL'] == "true" ) {
|
||||
if (( $array['BACKFILL'] == "true" ) && ( $array['BINARIES'] == "true" )) {
|
||||
if (( $array['BINARIES'] != "true" ) && ( $array['BACKFILL'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[2] and $panes0[3] Disabled by BINARIES and BACKFILL\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BACKFILL'] == "true" ) && ( $array['BINARIES'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$run_time1 = relativeTime( $array['BACKFILL_SEQ_TIMER'] + $time14 );
|
||||
$run_time2 = relativeTime( $array['BINARIES_SEQ_TIMER'] + $time13 );
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in $run_time2\n$panes0[3] will run in $run_time1\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $array['BACKFILL'] == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in T[$run_time]2 \n$panes0[3] will run in T[$run_time]1 \" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BACKFILL'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$run_time = relativeTime( $array['BACKFILL_SEQ_TIMER'] + $time14 );
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] will run in $run_time2\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $array['BINARIES'] == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['BINARIES'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$run_time = relativeTime( $array['BINARIES_SEQ_TIMER'] + $time13 );
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in $run_time1\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[2] will run in T[$run_time]\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//kill panes for sequential
|
||||
if ( $array['SEQUENTIAL'] == "true" ) {
|
||||
if (( $parts_rows_unformated > $array['BINARIES_MAX_ROWS'] ) && ( $array['BINARIES'] == "true" ) && ( $array['BINARIES_MAX_ROWS'] != 0 ) && ( $array['BACKFILL'] == "true" ) && ( $total_work_used > $array['BACKFILL_MAX_RELEASES'] ) && ( $array['BACKFILL_MAX_ROWS'] != 0 )) {
|
||||
if (( $parts_rows_unformated > $array['BINARIES_MAX_ROWS'] ) && ( $array['BINARIES'] == "true" ) && ( $array['BINARIES_MAX_ROWS'] != 0 ) && ( $array['BACKFILL'] == "true" ) && ( $total_work_used > $array['BACKFILL_MAX_RELEASES'] ) && ( $array['BACKFILL_MAX_ROWS'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\nBINARIES_MAX_ROWS and BACKFILL_MAX_ROWS exceeded\" && $ds1 $panes0[2] $ds4'");
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\nBINARIES_MAX_ROWS and BACKFILL_MAX_ROWS exceeded\" && $ds1 $panes0[3] $ds4'");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.2 'echo \"\033[38;5;\"$color\"m\n$panes0[2] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.3 'echo \"\033[38;5;\"$color\"m\n$panes0[3] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//runs nzb-import in 0.4 once if needed and exits
|
||||
if (( $killed != "true" ) && ( $array['IMPORT'] == "true" ) && (( $total_work_used < $array['IMPORT_MAX_RELEASES'] ) || ( $array['IMPORT_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['IMPORT_MAX_ROWS'] ) || ( $array['IMPORT_MAX_ROWS'] == 0 ))) {
|
||||
if (( $killed != "true" ) && ( $array['IMPORT'] == "true" ) && (( $total_work_used < $array['IMPORT_MAX_RELEASES'] ) || ( $array['IMPORT_MAX_RELEASES'] == 0 )) && (( $parts_rows_unformated < $array['IMPORT_MAX_ROWS'] ) || ( $array['IMPORT_MAX_ROWS'] == 0 )) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[4] $ds2 && cd $_bin && $nzb_cmd 2>&1 | tee -a $path/../logs/$panes0[4]-$getdate.log && echo \" \" && echo \" \033[1;0;33m\" && echo \"$_sleep_string {$array['IMPORT_SLEEP']} seconds...\" && sleep {$array['IMPORT_SLEEP']} && $ds1 $panes0[4] $ds3' 2>&1 1> /dev/null");
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.1 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[1] $ds2 && cd $_bin && $_php nzbcount.php 2>&1 | tee -a $path/../logs/$panes0[1]-$getdate.log' 2>&1 1> /dev/null");
|
||||
} elseif (( $parts_rows_unformated > $array['IMPORT_MAX_ROWS'] ) && ( $array['IMPORT'] == "true" ) && ( $array['IMPORT_MAX_ROWS'] != 0 )) {
|
||||
} elseif (( $parts_rows_unformated > $array['IMPORT_MAX_ROWS'] ) && ( $array['IMPORT'] == "true" ) && ( $array['IMPORT_MAX_ROWS'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\nIMPORT_MAX_ROWS exceeded\" && $ds1 $panes0[4] $ds4'");
|
||||
} elseif (( $total_work_used > $array['IMPORT_MAX_RELEASES'] ) && ( $array['IMPORT'] == "true" ) && ( $array['IMPORT_MAX_RELEASES'] != 0 )) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\nIMPORT_MAX_ROWS exceeded\" && $ds1 $panes0[4] $ds4' 2>&1 1> /dev/null");
|
||||
} elseif (( $total_work_used > $array['IMPORT_MAX_RELEASES'] ) && ( $array['IMPORT'] == "true" ) && ( $array['IMPORT_MAX_RELEASES'] != 0 ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\nIMPORT_MAX_RELEASES exceeded\" && $ds1 $panes0[4] $ds4'");
|
||||
} elseif ( $array['IMPORT'] != "true" ) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\nIMPORT_MAX_RELEASES exceeded\" && $ds1 $panes0[4] $ds4' 2>&1 1> /dev/null");
|
||||
} elseif (( $array['IMPORT'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\n$panes0[4] Disabled by IMPORT\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\n$panes0[4] Disabled by IMPORT\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.4 'echo \"\033[38;5;\"$color\"m\n$panes0[4] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//runs nzbcount in 0.1 loops
|
||||
if ( $array['IMPORT'] == "true" ) {
|
||||
if (( $array['IMPORT'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.1 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[1] $ds2 && cd $_bin && $_php nzbcount.php 2>&1 | tee -a $path/../logs/$panes0[1]-$getdate.log' 2>&1 1> /dev/null");
|
||||
} else {
|
||||
} elseif (( $array['IMPORT'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -k -t {$array['TMUX_SESSION']}:0.1 'echo \"\033[38;5;\"$color\"m\n$panes0[1] Disabled by IMPORT\" && $ds1 $panes0[1] $ds4'");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.1 'echo \"\033[38;5;\"$color\"m\n$panes0[1] Disabled by IMPORT\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.1 'echo \"\033[38;5;\"$color\"m\n$panes0[1] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
|
||||
//runs update_release and in 0.5 once if needed and exits
|
||||
if ( $array['RELEASES'] == "true" ) {
|
||||
if (( $array['RELEASES'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.5 'echo \"\033[38;5;\"$color\"m\" && $ds1 $panes0[5] $ds2 && cd $_bin && $_php update_releases.php 2>&1 | tee -a $path/../logs/$panes0[5]-$getdate.log && echo \" \033[1;0;33m\" && echo \"$_sleep_string {$array['RELEASES_SLEEP']} seconds...\" && sleep {$array['RELEASES_SLEEP']} && $ds1 $panes0[5] $ds3' 2>&1 1> /dev/null");
|
||||
} elseif ( $array['RELEASES'] != "true" ) {
|
||||
} elseif (( $array['RELEASES'] != "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.5 'echo \"\033[38;5;\"$color\"m\n$panes0[5] Disabled by RELEASES\nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.5 'echo \"\033[38;5;\"$color\"m\n$panes0[5] Disabled by RELEASES\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:0.5 'echo \"\033[38;5;\"$color\"m\n$panes0[5] Disabled by OPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//start postprocessing in window 2
|
||||
$post = $array['POST_TO_RUN'];
|
||||
for ($g=1; $g<=32; $g++)
|
||||
{
|
||||
$h=$g-1;
|
||||
$f=$h*100;
|
||||
$j=$g*2;
|
||||
if (( $array['POST_TO_RUN'] >= $g ) && ( $work_remaining_now > $f )) {
|
||||
$color = get_color();
|
||||
$color = get_color();
|
||||
if (( $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 | tee -a $path/../logs/$panes2[$h]-$getdate.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 )) {
|
||||
$color = get_color();
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h]\n$work_remaining_now < $f\nHas no work to process \nThis is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif (( $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\n$panes2[$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 -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h]\nDisabled by \nPOST_TO_RUN\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
} elseif ( $optimize_safe_to_run == "true" ) {
|
||||
shell_exec("$_tmux respawnp -t {$array['TMUX_SESSION']}:2.$h 'echo \"\033[38;5;\"$color\"m\n$panes2[$h]\nDisabled by \nOPTIMIZE\" && date +\"%D %T\" && echo \"This is color #$color\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
//check ffmpeg and mediainfo, kill if necessary
|
||||
if (( $array['KILL_PROCESS'] != "0" ) && ( $array['KILL_QUIET'] == "true" )) {
|
||||
if (( $array['KILL_PROCESS'] != "0" ) && ( $array['KILL_QUIET'] == "true" ) && ( $optimize_safe_to_run != "true" )) {
|
||||
echo "\n";
|
||||
shell_exec("killall -qo {$array['KILL_PROCESS']}s -9 mediainfo");
|
||||
shell_exec("killall -qo {$array['KILL_PROCESS']}s -9 ffmpeg");
|
||||
@@ -963,6 +1099,16 @@ while( $i > 0 )
|
||||
shell_exec("killall -o {$array['KILL_PROCESS']}s -9 ffmpeg 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
if (( $array['KILL_QUIET'] == "true" ) && ( $optimize_safe_to_run == "true" )) {
|
||||
echo "\n";
|
||||
shell_exec("killall -q mediainfo");
|
||||
shell_exec("killall -q ffmpeg");
|
||||
} else {
|
||||
echo "\n";
|
||||
shell_exec("killall mediainfo 2>&1 1> /dev/null");
|
||||
shell_exec("killall ffmpeg 2>&1 1> /dev/null");
|
||||
}
|
||||
|
||||
//notify monitor that optimize is running
|
||||
if (( ! shell_exec("$_tmux list-panes -t {$array['TMUX_SESSION']}:1 | grep 4: | grep dead" )) && ( $array['OPTIMIZE'] == "true" )) {
|
||||
echo "\033[1;41;33mOPTIMIZATION OF THE MYSQL TABLES HAS STARTED, DO NOT STOP THIS SCRIPT!\033[1;0;33m\n\n";
|
||||
|
||||
@@ -22,7 +22,7 @@ $_parts = $array['KEVIN_PARTS'];
|
||||
|
||||
$db = new DB;
|
||||
|
||||
$query = $db->queryOneRow(sprintf("select name from groups WHERE (first_record_postdate BETWEEN '${_date}' and now()) and (active = 1) order by name desc"));
|
||||
$query = $db->queryOneRow(sprintf("select name from groups WHERE (first_record_postdate BETWEEN '${_date}' and now()) and (active = 1) order by name ASC"));
|
||||
|
||||
$groupPost = $_parts;
|
||||
$groupName = $query['name'];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,8 @@ export ADMIN_PATH=$NEWZPATH"/www/admin"
|
||||
#to get the desired performance, 0 will disable all post processing
|
||||
export POST_TO_RUN="0"
|
||||
|
||||
#Enter the session name to be used by tmux
|
||||
#Enter the session name to be used by tmux, no spaces allowed in the name, this can be changed after scripts start
|
||||
#if you are running multiple servers, you could put your hostname here
|
||||
export TMUX_SESSION="Newznab"
|
||||
|
||||
#Set, in seconds - how often the monitor.php (left top pane) script should update, 0 may cause errors
|
||||
@@ -51,9 +52,12 @@ export KEEP_KILLED="false"
|
||||
|
||||
#You can have backfill loop constantly and interject binaries every so often
|
||||
#by setting this next to true, if true, the normal backfill pane will be dead
|
||||
#this works by setting the 2 start timers and which is run at the start of the loop is determined like this
|
||||
#if at the start of the loop, the BINARIES_SEQ_TIMER has expired, then update_binaries will run and the BINARIES_SEQ_TIMER timer is reset
|
||||
#if BINARIES_SEQ_TIMER has not expired, then if BACKFILL_SEQ_TIMER has expired, the backfill will run and BACKFILL_SEQ_TIMER timer is reset
|
||||
export SEQUENTIAL="false"
|
||||
|
||||
#time between loop start for update_binaries, in seconds
|
||||
#time between loop start for update_binaries, in seconds, this is a countdown timer, not a sleep after it runs
|
||||
#default is 30 minutes
|
||||
#will run on first loop and then not again for at least 1800 seconds
|
||||
export BINARIES_SEQ_TIMER="1800"
|
||||
@@ -119,7 +123,7 @@ export MAXDAYS="210"
|
||||
#then the script stops (once per loop), if your first_record_postdate on the group is 2012-06-24
|
||||
#it will be skipped (target reached). When that group is done, it will do another ( again from z to a).
|
||||
#this does not use increment, it works by the date set below
|
||||
#you also need to enable kevin's compression mod, those files are needed
|
||||
#you also need to enable kevin's compression mod, those files are needed and you still need to enable BACKFILL
|
||||
export KEVIN_SAFER="false"
|
||||
|
||||
#set the date to go back to, must be in the format of YYYY-MM-DD, like 2012-06-24
|
||||
@@ -187,6 +191,10 @@ export RELEASES_SLEEP="40"
|
||||
#optimize_myisam on small tables runs after every 5th loop of update_releases
|
||||
export OPTIMIZE="false"
|
||||
|
||||
#optimize can wait, patiently while all other panes stop and then run
|
||||
#or, forcefully terminate all panes while it runs, to kill all panes and run optimize, enable
|
||||
export OPTIMIZE_KILL="false"
|
||||
|
||||
#How often to run optimize_myisam on small tables seconds, default is 10 min
|
||||
export MYISAM_SMALL="600"
|
||||
|
||||
@@ -225,14 +233,25 @@ export CLEANUP_TIMER="3600"
|
||||
#to actually do anything, directions are in the file
|
||||
export PARSING="false"
|
||||
|
||||
#choose to use kevin123's update_parsing script
|
||||
export PARSING_MOD="false"
|
||||
|
||||
#How often do you want update_parsing.php to run, in seconds
|
||||
export PARSING_TIMER="3600"
|
||||
|
||||
############################################################
|
||||
|
||||
#Choose to run update_predb.php
|
||||
export PREDB="false"
|
||||
|
||||
#How often to update the PreDB in seconds
|
||||
export PREDB_TIMER="900"
|
||||
|
||||
############################################################
|
||||
|
||||
#update the tv schedule and in theaters listings
|
||||
export TV_SCHEDULE="false"
|
||||
|
||||
#How often to update the TV Schedule and the In Theaters in seconds
|
||||
export TVRAGE_TIMER="43200"
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
DROP TABLE IF EXISTS `binaryblacklist`;
|
||||
CREATE TABLE IF NOT EXISTS `binaryblacklist` (
|
||||
`ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`groupname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`regex` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`msgcol` int(11) unsigned NOT NULL DEFAULT '1',
|
||||
`optype` int(11) unsigned NOT NULL DEFAULT '1',
|
||||
`status` int(11) unsigned NOT NULL DEFAULT '1',
|
||||
`description` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1000100;
|
||||
|
||||
--
|
||||
-- Dumping data for table `binaryblacklist`
|
||||
--
|
||||
|
||||
INSERT INTO `binaryblacklist` (`ID`, `groupname`, `regex`, `msgcol`, `optype`, `status`, `description`) VALUES
|
||||
(100001, 'alt.binaries.*', '(brazilian|chinese|croatian|danish|deutsch|dutch|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|latin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)[\\)]?( \\-)?[ \\-\\.]((19|20)\\d\\d|(480|720|1080)(i|p)|3d|5\\.1|dts|ac3|truehd|(bd|dvd|hd|sat|vhs|web)\\.?rip|(bd.)?(h|x).?2?64|divx|xvid|bluray|svcd|board|custom|"|(d|h|p|s)d?v?tv|m?dvd(-|sc)?r|int(ernal)?|nzb|par2|\\b(((dc|ld|md|ml|dl|hr|se)[.])|(anime\\.)|(fs|ws)|dsr|pal|ntsc|iso|complete|cracked|ebook|extended|dirfix|festival|proper|game|limited|read.?nfo|real|rerip|repack|remastered|retail|samplefix|scan|screener|theatrical|uncut|unrated|incl|winall)\\b|doku|doc|dub|sub|\\(uncut\\))', 1, 1, 0, 'Blacklists non-english releases.'),
|
||||
(100002, 'alt.binaries.*', '[ -.](bl|cz|de|es|fr|ger|heb|hu|hun|ita|ko|kor|nl|pl|se)[ -.]((19|20)\\d\\d|(480|720|1080)(i|p)|(bd|dvd.?|sat|vhs)?rip?|(bd|dl)mux|( -.)?(dub|sub)(ed|bed)?|complete|convert|(d|h|p|s)d?tv|dirfix|docu|dual|dvbs|dvdscr|eng|(h|x).?2?64|int(ernal)?|pal|proper|repack|xbox)', 1, 1, 0, 'Blacklists non-english abbreviated releases.'),
|
||||
(100003, 'alt.binaries.*', '[ -.]((19|20)\\d\\d|(bd|dvd.?|sat|vhs)?rip?|custom|divx|dts)[ -.](bl|cz|de|es|fr|ger|heb|hu|ita|ko|kor|nl|pl|se)[ -.]', 1, 1, 0, 'Blacklists non-english abbreviated (reversed) releases.'),
|
||||
(100004, 'alt.binaries.*', '[ -.](chinese.subbed|dksubs|fansubs?|finsub|hebdub|hebsub|korsub|norsub|nordicsubs|nl( -.)?sub(ed|bed|s)?|nlvlaams|pldub|plsub|slosinh|swesub|truefrench|vost(fr)?)[ -.]', 1, 1, 0, 'Blacklists non-english subtitled releases.'),
|
||||
(100005, 'alt.binaries.*', '[ -._](4u\\.nl|nov[ a]+rip|realco|videomann|vost)[ -._]', 1, 1, 0, 'Blacklists non-english (release group specific) releases.'),
|
||||
(100006, 'alt.binaries.*', '[ -.]((bd|dl)mux|doku|\\[foreign\\]|seizoen|staffel)[ -.]', 1, 1, 0, 'Blacklists non-english (lang specific) releases.'),
|
||||
(100020, 'alt.binaries.*', '[ -.](imageset|pictureset|xxx)[ -.]', 1, 1, 0, 'Blacklists porn releases.'),
|
||||
(100030, 'alt.binaries.*', '[ -](de|es|fr|it|ko|nl|pl|se)[ -]((audiobook|cuefix|bonus|bootleg|dirfix|nfofix|dvb|promo|readnfo|real|rerip|repack|proper)[ -])?\\d?(bluray|hddvd|dvd|ddc|cd(s|rs|rep)?|mcd|(\\d_)?(vls|m?lp|ep|vinyl))', 1, 1, 0, 'Blacklists music, music video etc releases.'),
|
||||
(100040, 'alt.binaries.*', '[ -.](espn|ultimate.?fighter|mlb|mls|mfc|mma|ncaa|nba|nbl|nfl|nhl|pga|tna|ufc|us.?open|wec|wcw|world.?series|wwe|wwf)[ -.].*((480|720|1080)(i|p)|(d|h|p|s)d?tv|divx|(dvd.?|sat|vhs)rip|(h|x).?264|vcd|xvi ?d)', 1, 1, 0, 'Blacklists american and canadian sports releases.'),
|
||||
(100041, 'alt.binaries.*', '[ -.](anz|bundesliga|cfb|epl|fa.?cup|la.?liga|netball|nrl|rugby|serie.?a|supercup|super.?league|uefa|wimbledon)[ -.].*((480|720|1080)(i|p)|(d|h|p|s)d?tv|divx|(dvd.?|sat|vhs)rip|(h|x).?264|xvid)', 1, 1, 0, 'Blacklists european sports releases.'),
|
||||
(100042, 'alt.binaries.*', '[ -.](afl|fifa|fina|gymanstics|hdnet.?fights|iihf|league(.?challenge|.?cup|.?soccer)|olympics?|playoffs|wba|world.?championships?|world cup)[ -.].*((480|720|1080)(i|p)|(d|h|p|s)d?tv|divx|(dvd.?|sat|vhs)rip|(h|x).?264|xvid)', 1, 1, 0, 'Blacklists other sports releases.'),
|
||||
(100043, 'alt.binaries.*', '[ -.](bmx|motogp|sbk|superbike|tour.?de.?france|la.?vuelta|wsbk).*[ -.]((480|720|1080)(i|p)|(bi|motor)?cycle?(ing)?|(d|h|p|s)d?tv|divx|(dvd.?|sat|vhs)rip|(h|x).?264|rac(e|ing)|round|series|xvid)', 1, 1, 0, 'Blacklists bike racing releases.'),
|
||||
(100044, 'alt.binaries.*', '[ -.](ama.?supercross|dtm|f1.?legends|fia|formula(.?one|.?1|.?honda|.?renault)|gp3|grand.?prix|indycar|nascar|rally(.?challenge|.?championship)|supercars?|wrc|wtcc).*[ -.]((480|720|1080)(i|p)|(d|h|p|s)d?tv|divx|(dvd.?|sat|vhs)rip|(h|x).?264|rac(e|ing)|round|series|xvid)', 1, 1, 0, 'Blacklists car racing releases.'),
|
||||
(100045, 'alt.binaries.*', '[ -.](horse.?racing|kentucky.?derby).*[ -.]((480|720|1080)(i|p)|(d|h|p|s)d?tv|divx|(dvd.?|sat|vhs)rip|(h|x).?264|rac(e|ing)|xvid)', 1, 1, 0, 'Blacklists other racing releases.');
|
||||
|
||||
@@ -29,5 +29,4 @@ cd $NEWZPATH"/misc/update_scripts"
|
||||
$PHP update_database_version.php
|
||||
|
||||
cd $DIR/scripts
|
||||
ls -al
|
||||
./fix_files.sh
|
||||
|
||||
Reference in New Issue
Block a user