Files
newznab-tmux-NNTmux/scripts/reset_truncate.php
T
jonnyboy 0c9ea4fe43 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
2013-04-04 01:23:02 -04:00

27 lines
1.1 KiB
PHP

<?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");
?>