This commit is contained in:
2018-09-05 00:26:26 -07:00
parent bae448657b
commit ca7a7a8a58
4 changed files with 147 additions and 42 deletions

View File

@@ -3,7 +3,7 @@
// Yuba
// //
//////////////////////////////////////////
$version = "0.7.4";
$version = "0.7.5";
ini_set('memory_limit', '4096M');
date_default_timezone_set("America/Los_Angeles");
@@ -213,6 +213,7 @@ $dbo->exec("CREATE TABLE files (
Filename TEXT,
Extension TEXT,
Type TEXT,
Size INTEGER,
Inode INTEGER,
Perms INTEGER,
Owner TEXT,
@@ -227,7 +228,6 @@ $dbo->exec("CREATE TABLE files (
gfi_type TEXT,
gfi_attr TEXT,
gfi_created TEXT,
Size INTEGER,
has_exif INTEGER,
has_mediainfo INTEGER,
has_hash INTEGER,
@@ -833,6 +833,7 @@ foreach ($files as $splFileInfo) {
$stmt->BindValue(":Filename",$filename);
$stmt->BindValue(":Extension",$extension);
//stat
$stmt->BindValue(":stat",$sty[$j]);
if ($type == "link") {
@@ -864,8 +865,6 @@ foreach ($files as $splFileInfo) {
if ($type == "file") {
$fid = md5($splFileInfo->getSize().$splFileInfo->getMtime().$splFileInfo->getBasename());
$stmt->BindValue(":fid",$fid);
} else {
$stmt->BindValue(":fid",null);
}
// Size
@@ -886,8 +885,6 @@ foreach ($files as $splFileInfo) {
if ($type == "dir" || $type == "bundle" ) {
$items = chop(@shell_exec("find ".$shellpath." \( ! -regex '.*/\..*' \) | wc -l 2>&1"))-1;
$stmt->BindValue(":items",@$items);
} else {
$items = null;
}
// ------------------------------------------------ //
@@ -897,8 +894,6 @@ foreach ($files as $splFileInfo) {
if ($type == "dir") {
$newest = @filemtime(chop(shell_exec("find ".$shellpath." -type f -not -path '*/\.*' -print0 | xargs -0 stat -f \"%m %N\" | sort -rn 2>&1 | head -1 | cut -f2- -d\" \"")));
$stmt->BindValue(":newest",@$newest);
} else {
$newest = null;
}
// ------------------------------------------------ //
@@ -1027,6 +1022,20 @@ if (file_exists($error_log_file)) { echo file_get_contents($error_log_file); }
$seconds = floor($time = microtime(true)-$_SERVER["REQUEST_TIME_FLOAT"]);
$dbo->exec("UPDATE _skim SET status='completed_in_".$seconds."'");
// rsync
if ($p['rsync_dest']) {
echo "\nrsync...\n";
$command = "rsync -avv -e ssh ".$bpath." ".$p['rsync_dest'];
$count = trim(shell_exec("find ".escapeshellarg($bpath)." | wc -l"));
echo ProgressBar::start($count,"rsync");
$pipe = popen($command, "r");
while(fgets($pipe, 2048)) { echo ProgressBar::next(); }
pclose($pipe);
echo ProgressBar::finish();
}
echo "Finished in ".$seconds." seconds\n\n";
unset($dbo, $dbp, $files, $family, $fx);