using find to list and sed to switch the format to a timestamp touch can use we get the following work of art.
for i in $(find $document_root -name dvgrab-\*.mpg) ; do
touch -t $(echo $i | sed s/dvgrab-\([0-9]\{4\}\)\.([0-9]\{2\}\)\.\([0-9]\{2\}\)_\([0-9]\{2\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\)/\1\2\3\4\5\6/') $i
done
for i in $(find $document_root -name dvgrab-\*.mpg) ; do
touch -t $(echo $i | sed 's/dvgrab-\([0-9]\{4\}\)\.\([0-9]\{2\}\)\.\([0-9]\{2\}\)_\([0-9]\{2\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\).mpg/\1\2\3\4\5.\6/') $i;
done
My problem now is that touch tries to set the timestamp with the directories in front. How can I strip out the leading dirs?
touch: invalid date format `./dir2/200306291530.24'
touch: invalid date format `./dir1/200306291004.25'
for i in $(find $document_root -name dvgrab-\*.mpg) ; do
touch -t $(echo $i | sed 's/.*dvgrab-\([0-9]\{4\}\)\.\([0-9]\{2\}\)\.\([0-9]\{2\}\)_\([0-9]\{2\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\).mpg/\1\2\3\4\5.\6/') $i;
done