mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-30 09:48:55 +00:00
added timer for update_releases, added postprocessing totals, removed username
added a few notes
This commit is contained in:
+10
-5
@@ -49,6 +49,7 @@ $_testing_path = getenv('TESTING_PATH');
|
||||
$_mysql = getenv('MYSQL');
|
||||
$_php = getenv('PHP');
|
||||
$_nntp = getenv('NNTP_SLEEP');
|
||||
$_rel_sleep = getenv('RELEASES_SLEEP');
|
||||
$_threads = getenv('THREADS');
|
||||
$_innodb = getenv('INNODB');
|
||||
|
||||
@@ -138,7 +139,10 @@ while($i>0)
|
||||
passthru('clear');
|
||||
printf("\033[1;34mMonitor\033[0m has been running for: $time_string\n");
|
||||
printf("$releases_since_loop releases added in the previous $sleeptime seconds.\n");
|
||||
printf("$releases_now($signed$releases_since_start) releases in your database.\n\n");
|
||||
printf("$releases_now($signed$releases_since_start) releases in your database.\n");
|
||||
printf("$total_work_now releases left to postprocess.");
|
||||
if ( $_max_releases != 0 ) { printf(" update_binaries, backfill and nzb-import will stop running when you exceed $_max_releases\n\n"); }
|
||||
else { printf("\n\n"); }
|
||||
|
||||
$mask = "%16s %10s %10s \n";
|
||||
printf($mask, "Category", "In Process", "In Database");
|
||||
@@ -150,6 +154,7 @@ while($i>0)
|
||||
printf($mask, "PC(4000)","$pc_releases_proc","$pc_releases_now");
|
||||
printf($mask, "TVShows(5000)","$tvrage_releases_proc","$tvrage_releases_now");
|
||||
printf($mask, "Additional Proc","$work_remaining_now","$additional_releases_now");
|
||||
printf($mask, "Total Releases","$total_work_now","$releases_now");
|
||||
|
||||
if ((TIME() - $time2) >= 900 ) {
|
||||
shell_exec("tmux respawnp -t Newznab-dev:1.0 'cd $_newznab_path && $_php update_predb.php true && date && echo \"$_string\"' 2>&1 1> /dev/null");
|
||||
@@ -242,19 +247,19 @@ if ( ! $_inno_test ) {
|
||||
}
|
||||
}
|
||||
|
||||
if (( $total_work_now < $_max_releases ) && ( $_binaries == "true" )) {
|
||||
if (( $total_work_now < $_max_releases ) || ( $_max_releases == 0 ) && ( $_binaries == "true" )) {
|
||||
shell_exec("tmux respawnp -t Newznab-dev:0.11 'cd $_update_path && $_php $_update_cmd && date && echo \"sleeping $_nntp seconds...\" && sleep $_nntp && echo \"$_string\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
if (( $total_work_now < $_max_releases ) && ( $_backfill == "true" )) {
|
||||
if (( $total_work_now < $_max_releases ) || ( $_max_releases == 0 ) && ( $_backfill == "true" )) {
|
||||
//shell_exec("tmux respawnp -t Newznab-dev:0.12 '$_mysql -u$_DB_USER -h $_DB_HOST --password=$_DB_PASSWORD $_DB_NAME -e \"${backfill_increment}\"' 2>&1 1> /dev/null");
|
||||
shell_exec("tmux respawnp -t Newznab-dev:0.12 'cd $_update_path && $_php $_backfill_cmd && \
|
||||
$_mysql -u$_DB_USER -h $_DB_HOST --password=$_DB_PASSWORD $_DB_NAME -e \"${backfill_increment}\" && \
|
||||
date && echo \"sleeping $_nntp seconds...\" && sleep $_nntp && echo \"$_string\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
if (( $total_work_now < $_max_releases ) && ( $_import == "true" )) {
|
||||
if (( $total_work_now < $_max_releases ) || ( $_max_releases == 0 ) && ( $_import == "true" )) {
|
||||
shell_exec("tmux respawnp -t Newznab-dev:0.13 'cd $_import_path && $_php $_import_cmd \"$_nzbs\" true && date && echo \"$_string\"' 2>&1 1> /dev/null");
|
||||
}
|
||||
shell_exec("tmux respawnp -t Newznab-dev:0.14 'cd $_newznab_path && $_php update_releases.php && date && echo \"$_string\"' 2>&1 1> /dev/null");
|
||||
shell_exec("tmux respawnp -t Newznab-dev:0.14 'cd $_newznab_path && $_php update_releases.php && date && echo \"sleeping $_rel_sleep seconds...\" && sleep $_rel_sleep && echo \"$_string\"' 2>&1 1> /dev/null");
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
+21
-11
@@ -10,31 +10,39 @@ export TESTING_PATH=$NEWZPATH"/misc/testing"
|
||||
export ADMIN_PATH=$NEWZPATH"/www/admin"
|
||||
export INNODB_PATH=$DIR"/bin/innodb"
|
||||
|
||||
#Select the user name that will run these scripts
|
||||
export USERNAME="what is your username"
|
||||
|
||||
#Enter the session name to be used by tmux
|
||||
export TMUX_SESSION="Newznab-dev"
|
||||
|
||||
#Set, in seconds - how often the monitor.php script should up, 0 may cause errors
|
||||
#Set, in seconds - how often the monitor.php (left top pane) script should update, 0 may cause errors
|
||||
export MONITOR_UPDATE="20"
|
||||
|
||||
#Set, in seconds - how long the update_binaries and backfill should sleep between runs, 0 may cause errors
|
||||
export NNTP_SLEEP="10"
|
||||
export NNTP_SLEEP="20"
|
||||
|
||||
#Set the maximum days tp backfill
|
||||
#Set, in seconds - how long the update_release should sleep between runs, 0 may cause errors
|
||||
export RELEASES_SLEEP="20"
|
||||
|
||||
#Set the maximum days to backfill, you set the nn+ admin/edit backfill to 1
|
||||
#this will increment your database by 1 after each backfill loop
|
||||
#once your backfill numbers reach $MAXDAYS, then it will no long increment the database
|
||||
#backfill will continue to run, and do no work, at that point you should disable backfill, below
|
||||
export MAXDAYS="210"
|
||||
|
||||
#Set the path to the nzb dump you downloaded from torrents
|
||||
#Set the path to the nzb dump you downloaded from torrents, theis is the path to bulk files folder of nzbs
|
||||
#this does not recurse through subfolders
|
||||
export NZBS="/path/to/nzbs"
|
||||
|
||||
#Choose to run the threaded or non-threaded newznab scripts true/false
|
||||
#such as update_binaries.php or update_binaries_threaded.php
|
||||
export THREADS="true"
|
||||
|
||||
#Choose your database, comment the one true/false
|
||||
#Choose your database engine, comment the one true/false
|
||||
#you should have already converted your database to InnoDB engine, if you select true here
|
||||
export INNODB="true"
|
||||
|
||||
#Choose to run update_cleanup.php true/false
|
||||
#set to false by default, you will need to edit /misc/testing/update_cleanup.php to actually do anything
|
||||
#directions are in the file
|
||||
export CLEANUP="false"
|
||||
|
||||
#Choose to run update_binaries true/false
|
||||
@@ -47,16 +55,18 @@ export BACKFILL="true"
|
||||
export IMPORT="true"
|
||||
|
||||
#Choose to run optimise_db script true/false
|
||||
export OMPTIMISE="false"
|
||||
export OMPTIMISE="true"
|
||||
|
||||
#Set the max amount of unprocessed releases and still allow import or backfill to run
|
||||
export MAX_RELEASES="100000"
|
||||
#Set the max amount of unprocessed releases and still allow nzb-import, backfill and update_releases to run
|
||||
#set to 0 to disable
|
||||
export MAX_RELEASES="0"
|
||||
|
||||
#Specify your SED binary
|
||||
export SED="/bin/sed"
|
||||
#export SED="/usr/local/bin/gsed"
|
||||
|
||||
#Select some monitoring script, if they are not installed, it will not affect the running of the scripts
|
||||
#these are set to false by default, enable if you want them
|
||||
export USE_HTOP="false"
|
||||
export USE_NMON="false"
|
||||
export USE_BWMNG="false"
|
||||
|
||||
@@ -25,7 +25,7 @@ cp conf/tmux.conf conf/tmux_user.conf
|
||||
$SED -i 's,'changeme,"$NZBS"',' "conf/tmux_user.conf"
|
||||
|
||||
printf "\033]0; $TMUX_SESSION\007\003\n"
|
||||
$TMUX -f conf/tmux_user.conf new-session -d -s $TMUX_SESSION -n NewzNab-dev 'cd bin && echo "monitor Working......" && nice -n 19 $PHP monitor.php -i'
|
||||
$TMUX -f conf/tmux_user.conf new-session -d -s $TMUX_SESSION -n $TMUX_SESSION 'cd bin && echo "monitor Working......" && nice -n 19 $PHP monitor.php -i'
|
||||
$TMUX selectp -t 0
|
||||
$TMUX splitw -h -p 72 'echo "..."'
|
||||
$TMUX splitw -h -p 50 'echo "..."'
|
||||
|
||||
Reference in New Issue
Block a user