[CentOS] tar-ing subdirectories separately

Sun Jan 23 20:51:33 UTC 2011
Johan Martinez <jmartiee at gmail.com>

I want to backup a directory using tar, but want separate tarballs for each
subdirectory. For example:
# ls dir1
subdir1 subdir2 subdir3

Will it possible to do it using only tar command? Or will I need another
separate piece of logic/control? I thought of writing a shell script with
three tar commands for each subdirectory, but that's not elegant way of
doing it. Also, it may not scale as number of subdirectories change. Any
other solutions or tips for doing this will be really helpful.

Thank you
jM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20110123/96e61476/attachment-0004.html>