Jump to content

File listings


Rob W
 Share

Recommended Posts

we have a numberof add-on USB discs scattered around the company with lotsof duplicate filels on them

 

is there a piece of software that will give me a searchable file listing?

Link to comment
Share on other sites

Not sure what you mean, are you saying that you want to catalogue whats on each drive? So that you can search a single place to find which USB drive a file is on?

 

If so, then it would be straight forward to create something using php and mySQL although Im sure something like that is probably already out there.

 

Alternatively, you could just copy all the contents onto one hard drive B)

Link to comment
Share on other sites

pHp and SQL are dark arts to us

 

and the Disk drive would be bloody enormous - we're talking about 10 TB of data - it would take ages just to copy it and then we'd lose the information as to where the original data was stored................

 

Karen's Tools can do it drive by drive but the output format is grim .............

Link to comment
Share on other sites

php and mySQL would be the easiest and could therefore be stored on the net or an intranet. As long as your hosting contains mySQL and PHP (most do).

 

Run the following mySQL command to create the database and table:

 

create database files;

CREATE TABLE file_list
(
id int unsigned not null auto_increment primary key,
file_name varchar(100),
drive_name varchar(50),
file_size varchar(20),
file_modified varchar(20)
);

 

The PHP code which can then be ran on any machine is as follows:

 

<?

//----This bit would be best put into a form but I couldnt be arsed to do one;) -----
//define the path to find the files
$path = "eg D:/";
//give the drive a name, anything you like as long as each ones unique
$drive = "Give the drive a name ie the big yellow USB drive or summit";
//---------------------------------------------------------------------------------------------

$dir_handle = @opendir($path) or die("Unable to open $path");

echo "Directory Listing of $path<br/>";
while ($file = readdir($dir_handle)) 
{
  if($file!="." && $file!="..")
  echo "<a href='$file'>$file</a><br/>";
  $size=filesize($file);
  $mod=filemtime($file);
  $sql = "INSERT INTO `file_list` (`id`, `file_name`, `drive_name`, `file_size`, `file_modified`) VALUES ('','$file', '$drive','$size','$mod')";
$result = mysql_query($sql) or die("Bad query: " . mysql_error());
}
closedir($dir_handle);

?> 

 

et voila, an online directory structure for your 10Tb of data showing the filename, which drive it is on, its size and last modified date, you can then run SQL queries to find things, highlight duplicates etc.

 

Now then thats 30 minutes PHP consultancy at an extortionate fee, just bung a cheque in the post.

 

 

pHp and SQL are dark arts to us

 

and the Disk drive would be bloody enormous - we're talking about 10 TB of data - it would take ages just to copy it and then we'd lose the information as to where the original data was stored................

 

Karen's Tools can do it drive by drive but the output format is grim .............

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.