=================================================================== RCS file: /cvs/wpscripts/zlist/zlist,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- wpscripts/zlist/zlist 2011/06/03 09:28:47 1.1 +++ wpscripts/zlist/zlist 2011/07/19 16:12:10 1.2 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: zlist,v 1.1 2011/06/03 09:28:47 yason Exp $ +# $Id: zlist,v 1.2 2011/07/19 16:12:10 yason Exp $ use DBI; use Term::ANSIColor qw(:constants); use Time::HiRes qw(gettimeofday tv_interval); @@ -7,9 +7,9 @@ $| = 1; # database -our $server = "MSSQL"; -our $user = "it_men"; -our $pass = "itmen712"; +our $server = "pdc"; +our $user = "sa"; +our $pass = "aekghbynflvby"; our $dsn = "DBI:Sybase:server=$server"; our $sth; @@ -46,13 +46,13 @@ } else { - if( -e "/var/log/ztransfer/FILE" && -e "/var/log/ztransfer/ACTION") + if( -e "/var/log/wpscripts/ztransfer/FILE" && -e "/var/log/ztransfer/ACTION") { - open(CURRENT, "/var/log/ztransfer/FILE"); + open(CURRENT, "/var/log/wpscripts/ztransfer/FILE"); my $file = ; close(CURRENT); - open(CURRENT, "/var/log/ztransfer/ACTION"); + open(CURRENT, "/var/log/wpscripts/ztransfer/ACTION"); my $action = ; close(CURRENT); @@ -79,21 +79,6 @@ print "\n"; - # fetch jpegs - db_fetch(1); - -# print "****** jpegs ($#numcard) ******\n"; - print BOLD WHITE ON_BLUE "Очередь джепегов". RESET . " ($#numcard штук) :\n"; - $i = 0; - while( ($numcard[$i]) ) - { - print "$numcard[$i]\t[ оформлено $time[$i], приоритет=$pri[$i], файл=$path[$i] (размер=$size[$i]) ]\n"; - $i++; - $total++; - } - print "\n"; - - # fetch probas db_fetch(2); @@ -126,7 +111,7 @@ sub db_select() { - $dbh->do("use Manager"); + $dbh->do("use full_print"); } @@ -136,7 +121,7 @@ my $i = 0; my $searchpath; - $sth = $dbh->prepare ("SELECT NumCard,Path,time_file,file_priority,tx_count FROM upload_files WHERE Status=0 AND type_file=$type_file") or die "SQL prepare failed\n"; + $sth = $dbh->prepare ("SELECT numcard,path,time_file,file_priority,tx_count FROM upload_files WHERE status=0 AND type_file=$type_file") or die "SQL prepare failed\n"; $sth->execute( ) or die "unable to execute query $query error $DBI::errstr"; # zero elements @@ -161,8 +146,8 @@ # make local file path $searchpath =~ tr/\\/\//; $searchpath = '/WIDEPRINT/' . $searchpath; - # follow symlink to achieve real path - chomp( $_ = `dirname $searchpath | xargs /usr/bin/readlink` ); chomp( $searchpath = $_ . '/' . `basename $searchpath` ); +# # follow symlink to achieve real path +# chomp( $_ = `dirname $searchpath | xargs /usr/bin/readlink` ); chomp( $searchpath = $_ . '/' . `basename $searchpath` ); # finally, get file size $size[$i] = -s $searchpath;