source: trunk/checktar.php@ 5

Last change on this file since 5 was 1, checked in by zollarsd, 12 years ago

Initial import

File size: 712 bytes
Line 
1<?php
2
3include "listen-config.php";
4
5$gfac_link = mysql_connect( $dbhost, $guser, $gpasswd );
6
7$result = mysql_select_db( $gDB, $gfac_link );
8
9$query = "SELECT id, time, cluster, tarfile FROM analysis ";
10$result = mysql_query( $query, $gfac_link );
11
12while ( $row = mysql_fetch_assoc( $result ) )
13{
14 $tarfile = $row[ 'tarfile' ];
15 $id = $row[ 'id' ];
16 $time = $row[ 'time' ];
17
18 $cluster = $row[ 'cluster' ];
19
20 $i = 0;
21
22 if ( strlen( $tarfile ) == 0 ) echo "id $id is null\n";
23
24 else
25 {
26 $fn = "test" . $i++ . ".tar";
27 file_put_contents( $fn, $tarfile );
28 $i++;
29 echo "cluster $cluster; time $time; $id:\n";
30 passthru( "tar -xvf $fn" );
31 echo "\n";
32
33
34 }
35
36}
37
Note: See TracBrowser for help on using the repository browser.