don't really have a script for this but you can use a foreach statement to loop through each directory
here's the psuedo i'd use:
array = folders to search
(eg $arr = array("/documents/2004","/documents/2005", ...etc... ))
foreach $arr
foreach $file in $arr (ignore ".." and ".")
insert $file_info from $file into database
I don't have time at the moment for creating the actual code, but if there is no response by the time I get some time, I will try to put something together for you if you don't already have something.