[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Archiving directories/files with "compressed" mirror version
- Subject: [ale] Archiving directories/files with "compressed" mirror version
- From: rekoil at semihuman.com (Chris Woodfield)
- Date: Wed, 13 Aug 2008 14:31:44 -0400
I'm handling a request that I'd be surprised if no one's run into
before, so I figured I'd
The request is to be able to walk a directory tree and make a mirrored
copy of the directory, but with every file compressed. Not make a
single archive of the dir - the end result will have all directories
with the same names, perms, etc, but each file will be a bzip'ed
version of the original.
So, given the following files:
foo/file1.txt
foo/bar/
foo/bar/file2.txt
foo/bar/file3.txt
foo/baz/
foo/baz/file4/txt
The resulting dir will look like:
foo.archive/
foo.archive/file1.txt.bz2
foo.archive/bar/
foo.archive/bar/file2.txt.bz2
foo.archive/bar/file3.txt.bz2
foo.archive/baz/
foo.archive/baz/file4.txt.bz2
Anyone out there have working code to do something like this? Perl
preferred...
Thanks,
-C