On Thu, 20 Sep 2012 20:33:39 +0800 Andrew Lowe <a...@wht.com.au> wrote:
> Hi all, > I have the situation where I have a large amount of data, > many TB's, made up of many, many files. This information has now been > archived but I've got people who want to be able to see what data > does/does not exist, filling in gaps where they may exist. > > As this data used to be available/visible in a directory > structure, ie via a file browser, I thought the easiest way for them > to see if something existed would be to create a mirror of the > directory structure and then populate this dir structure with 1 - 5 > byte files with the same name as the "real" data files that now > reside in the archive. I've seen some scripts on the interweb that > allow me to create the dir structure, but does anyone have any ideas > how to do the creation of the "marker" files in the active file > system? > > Just buying more hard disks and keeping the data on line also > isn't an option. > > Any thoughts, greatly appreciated, > > Andrew > I don't understand why you specify 1-5 byte files. Those few bytes will always be useless. Rather use 0-length files. On the archive: find /root/of/dir/structure -type d > dirs.txt find /root/of/dir/structure -type f > files.txt Copy those two files to the on-line system: for I in `cat dirs.txt` ; do mkdir -p $I ; done for I in `cat files.txt` ; do touch -p $I ; done Do that in the appropriate top-level directory of course. You can probably make it more efficient using decent options to xargs, but what the hell, I'd do it as-is. It's a once off action and finding the xargs man page will take longer than the mkdirs.... -- Alan McKinnon alan.mckin...@gmail.com